Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

✨A like button with delightful star animation powered by Vue.js

License

NotificationsYou must be signed in to change notification settings

OYsun/VueStar

Repository files navigation


查看中文文档,请移步至这里

demo

For a better demonstration, please use the phone scan the following two-dimensional code view demo,or click this linkhttp://web-oysun.cn/VueStar/

API

Props

OptionTypeDescription
animateStringTo activate the animation of the like button
colorStringActivate the like button, the color of the button. (note to must be hex or RGB color code)

Slot

SlotNameDescription
iconSet up the like button

Detailed instructions

Props

animate

animateSpecify the like button animation, the default is no animation, you can add animation CSS class, of course, can also introduce CSS animation library, such as animate.css

color

colorActivate the button when the button color changes, the default is not. Note: The value of this parameter must be filled in hex or rgb color code, rather than the css class

Slot

icon

iconTo theslot inside fill in any content you want, it is the carrier of the like button

abuout event

Events should be bound in theslot

<template>  <vue-staranimate="animated rubberBand"color="#F05654">    <aslot="icon"class="fa fa-heart"@click="handleClick"></a>  </vue-star></template></script>exportdefault {  methods: {handleClick () {//do something    }  }}</script>

Simple example

<vue-staranimate="yourAnimateCssClass"color="rgb(152, 138, 222)"><imgslot="icon"src="./yourImgPlace/yourImg.png"/></vue-star>
<!--use animate.css and font-awesome --><vue-staranimate="animated bounceIn"color="#F05654"><islot="icon"class="fa fa-heart"></i></vue-star>

Installation and use

npminstallvue-star
  • If used as a global component
//In the project entry fileimportVuefrom'vue'importVueStarfrom'vue-star'Vue.component('VueStar',VueStar)
  • If as a local component
//In a componentimportVueStarfrom'vue-star'exportdefault{components:{    VueStar}}

Bug and suggestions

If you encounter problems or suggestions in the use, welcome toissues

LICENSE

MIT

About

✨A like button with delightful star animation powered by Vue.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp