mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
981 B
981 B
Rate 评分
使用指南
import { Rate } from 'vant';
Vue.use(Rate);
代码演示
基础用法
<van-rate v-model="value" />
export default {
data() {
return {
value: 3
};
}
}
自定义颜色
<van-rate
v-model="value"
:size="25"
:todal="6"
:color="color",
:defaultColor="defaultColor"
/>
禁用状态
<van-rate v-model="value" disabled />
Rate API
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
v-model | 当前分数 | Number |
- |
size | 星标大小,单位为px |
Number |
20 |
total | 总分 | Number |
5 |
color | 选中时的星标颜色 | String |
#ffd21e |
default-color | 未选中时的星标颜色 | String |
#c7c7c7 |
disabled-color | 不可选时的星标颜色 | String |
#bdbdbd |
disabled | 是否禁用评分 | Boolean |
false |