https://github.com/savoygu/vue-star-plus
升级版 vue-star
https://github.com/savoygu/vue-star-plus
star vue vue-star vue-star-plus
Last synced: 6 months ago
JSON representation
升级版 vue-star
- Host: GitHub
- URL: https://github.com/savoygu/vue-star-plus
- Owner: savoygu
- License: mit
- Created: 2017-12-21T11:47:53.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-12-20T11:01:32.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T18:52:34.079Z (7 months ago)
- Topics: star, vue, vue-star, vue-star-plus
- Language: SCSS
- Homepage: https://savoygu.github.io/vue-star-plus/
- Size: 1.64 MB
- Stars: 27
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-star-plus
| Feature | [vue-star](https://github.com/OYsun/VueStar) | vue-star-plus |
| -------------- | -------------------------------------------- | ------------- |
| Icon | ✅ | ✅ |
| Animation | ✅ | ✅ |
| Image | ❌ | ✅ |
| Default Active | ❌ | ✅ |## Install
### Vue3
```bash
npm install vue-star-plus
``````javascript
import { createApp } from 'vue'
import VueStarPlus from 'vue-star-plus'
import 'vue-star-plus/style.css'
const app = createApp()
// Global register
app.component('VueStarPlus', VueStarPlus)
```### Vue2
```bash
npm install vue-star-plus@2
``````javascript
import Vue from 'vue'
import VueStarPlus from 'vue-star-plus' // same with vue3 version
import 'vue-star-plus/style.css' // same with vue3 version
// Global register
Vue.component('VueStarPlus', VueStarPlus)
```## Usage
[DEMO](https://savoygu.github.io/vue-star-plus/)
### Basic Usage
```javascript
❤
const active = ref(false)
```
### Background Image
```javascript
const active = ref(false)
.vsp__bgi {
display: block;
width: 36px;
height: 36px;
background: url("/src/assets/inactive.png") no-repeat;
background-size: contain;
}
.vsp__bgi.is-active {
background-image: url("/src/assets/active.png");
}```
### Animated
```javascript
❤
const active = ref(false)
@import 'animate.css';
```
## License
The vue-star-plus package is also open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).