当前位置: 首页 > 文档资料 > Feui 中文文档 >

Rater 评价

优质
小牛编辑
131浏览
2023-12-01
import { Rater } from 'feui';
components: {
  [Rater.name]: Rater
}

代码演示

基础用法

<fe-cell title="设置默认" inline-desc="总共5星如果不改变的话">
  <fe-rater v-model="data3" slot="value"></fe-rater>
</fe-cell>

自定义颜色

<fe-cell title="自定义颜色">
  <fe-rater v-model="data2" slot="value" :max="6" active-color="red"></fe-rater>
</fe-cell>

不可用状态

<fe-cell title="不可用状态">
  <fe-rater v-model="data4" slot="value" disabled></fe-rater>
</fe-cell>

小数形式

<fe-cell title="小数形式">
  <fe-rater value='3.5' slot="value" active-color="red" disabled></fe-rater>
</fe-cell>

自定义大小

<fe-cell title="自定义大小15px">
  <fe-rater v-model="data42" slot="value" active-color="red" :font-size="15"></fe-rater>
</fe-cell>

自定义小图标

<fe-group title="自定义图标">
  <fe-cell title="小心心">
    <fe-rater v-model="data4" slot="value" star="♡" active-color="red" :margin="15"></fe-rater>
  </fe-cell>
  <fe-cell title="发光的太阳">
    <fe-rater v-model="data5" slot="value" star="☼" active-color="#4a90e2" :margin="4"></fe-rater>
  </fe-cell>
  <fe-cell title="笑脸">
    <fe-rater v-model="data5" slot="value" star="☻" active-color="#4a90e2" :margin="4"></fe-rater>
  </fe-cell>
  <fe-cell title="小星星">
    <fe-rater v-model="data5" slot="value" star="✩" active-color="red" :margin="4"></fe-rater>
  </fe-cell>
  <fe-cell title="囧">
    <fe-rater v-model="data5" slot="value" star="囧" active-color="#4a90e2" :margin="4"></fe-rater>
  </fe-cell>
  <fe-cell title="诺">
    <fe-rater v-model="data5" slot="value" star="诺" active-color="#FD6E0E" :margin="4"></fe-rater>
  </fe-cell>
</fe-group>

API

参数说明类型默认值可选值
value显示结果用v-model绑定Number0-
disabled按钮是否可用Booleanfalsetrue,false
max最多可选的数量Number5-
star显示的字符String-
active-color选中时的颜色String#4a90e2可用是16进制颜色值也可以是颜色名称
margin间距Number2-
font-size字体大小Number25-
-----