Vue Tiny Rate
The Smallest Rating Component for Vuejs
based single-line rate component
{ return "★★★★★☆☆☆☆☆";} // "★★★☆☆"
Features
- based ☆ and ★
- support float such as 3.5 4.7
- theme
- animate
- size
Translation
Installation and usage
Once, install rate component for your project
npm install vue-tiny-rate --save
Import Vue Rate into your app
; components: Rate
Use HTML template
Options from props
value {number|string}
: Star valuedefault:0
readonly {boolean}
: Rate read-only.default:false
length {number|string}
: Star sizedefault:5
theme {color|enum('yellow','green','blue','red','purple','orange','black','wihte')}
: Star color.default: yellow
YellowGreenBlueRedPurpleOrangeBlack#91d5ff
size {number|string}
: Rate size.
12px16px20px40px
animate {number|string}
: Rate animate duration.default:0
1s2s3s
Events
onRate
: Rate select callback.
el: '#app' components: Rate template: '<Rate @onRate="onrate" :value="value"/>' data: value: '2.6' methods: { console thisvalue = num }
Link
License
MIT.