Rate 评分

使用指南

在 app.json 或 index.json 中引入icon、rate组件

{
  "usingComponents": {
    "fs-rate": "path/components/rate/index"
  }
}
1
2
3
4
5

代码演示

基本使用

<fs-rate value="3"/>
1

自定义图标

<fs-rate value="1" icon="heart-o" void-icon="heart"/>
1

自定义样式

<fs-rate
  value="2"
  size="25"
  count="6"
  color="#2ba"
  void-color="#ceefe8"/>
1
2
3
4
5
6

禁用状态

<fs-rate value="3" disabled/>
1

属性

参数 说明 类型 默认值
value 是否展示组件 Number -
disabled 是否展示组件 Boolean -
count 后动画时长,单位为毫秒 Number 5
size 自定义样式 Number 20
color 自定义的外部样式类 String #ffd21e
void-color 自定义的外部样式类 String #c7c7c7
disabled-color 自定义的外部样式类 String #bdbdbd
icon 自定义的外部样式类 String star-o
void-icon 自定义的外部样式类 String star

事件

名称 说明 回调参数
bind:change 当前分值变化时触发的事件 当前分值