VueStar
:sparkles:A like button with delightful star animation powered by Vue.js
Install / Use
/learn @OYsun/VueStarREADME
VueStar
<img src="./src/images/logo-01.gif">查看中文文档,请移步至 这里
demo
For a better demonstration, please use the phone scan the following two-dimensional code view demo,or click this link http://web-oysun.cn/VueStar/
<img src="./src/images/demo.png" width="50%">API
Props
| Option | Type | Description | | ------------- |-------------| -----| | animate | String | To activate the animation of the like button| | color | String | Activate the like button, the color of the button. (note to must be hex or RGB color code) |
Slot
| SlotName | Description | | -------------| -----| | icon | Set 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 the slot inside fill in any content you want, it is the carrier of the like button
abuout event
Events should be bound in the slot
<template>
<vue-star animate="animated rubberBand" color="#F05654">
<a slot="icon" class="fa fa-heart" @click="handleClick"></a>
</vue-star>
</template>
</script>
export default {
methods: {
handleClick () {
//do something
}
}
}
</script>
Simple example
<vue-star animate="yourAnimateCssClass" color="rgb(152, 138, 222)">
<img slot="icon" src="./yourImgPlace/yourImg.png" />
</vue-star>
<!--use animate.css and font-awesome -->
<vue-star animate="animated bounceIn" color="#F05654">
<i slot="icon" class="fa fa-heart"></i>
</vue-star>
Installation and use
npm install vue-star
- If used as a global component
//In the project entry file
import Vue from 'vue'
import VueStar from 'vue-star'
Vue.component('VueStar', VueStar)
- If as a local component
//In a component
import VueStar from 'vue-star'
export default {
components: {
VueStar
}
}
Bug and suggestions
If you encounter problems or suggestions in the use, welcome to issues
LICENSE
MIT
Related Skills
diffs
341.2kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
1.9kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
HappyColorBlend
HappyColorBlendVibe Project Guidelines Project Overview HappyColorBlendVibe is a Figma plugin for color palette generation with advanced tint/shade blending capabilities. It allows designers to
