1.0.0 • Published 7 years ago
vue-givescores v1.0.0
一个简单的vue打分插件 支持npm 安装
npm install vue-slide-mini --save
在main.js中引入
import giveScore from 'vue-givescore'
Vue.use(giveScore)
然后就可以全局使用了 在要用的地方直接插入标签
<give-score :target="demo1" @haveGive="haveGive" size="24"></give-score>
接受星星大小(目前仅定义了width:11px和width:24px的两种),有必要可以自己修改源码的css样式,更换背景图片即可 target为打分目标,点击星星会给该对象添加一个score属性,score即为打的分数.如需自己添加事件也可以使用回调事件haveGive,
haveGive (index) {
alert('你打了' + index + '分')
}
1.0.0
7 years ago