Skip to content

Rate 评分

规则

js
{
    type:"rate",
    field:"rate",
    title:"推荐级别",
    value:3.5,
    props:{
        max: 10,
    },
    validate:[
        {required:true,type:'number',min:3, message: '请大于3颗星',trigger:'change'}
    ]
}
{
    type:"rate",
    field:"rate",
    title:"推荐级别",
    value:3.5,
    props:{
        max: 10,
    },
    validate:[
        {required:true,type:'number',min:3, message: '请大于3颗星',trigger:'change'}
    ]
}

参考:Element_Rate

value :Number

Props

参数说明类型可选值默认值
max最大分值number5
disabled是否为只读booleanfalse
allowHalf是否允许半选booleanfalse
lowThreshold低分和中等分数的界限值,值本身被划分在低分中number2
highThreshold高分和中等分数的界限值,值本身被划分在高分中number4
colorsicon 的颜色数组,共有 3 个元素,为 3 个分段所对应的颜色array['#F7BA2A', '#F7BA2A', '#F7BA2A']
voidColor未选中 icon 的颜色string#C6D1DE
disabledVoidColor只读时未选中 icon 的颜色string#EFF2F7
iconClassesicon 的类名数组,共有 3 个元素,为 3 个分段所对应的类名array['el-icon-star-on', 'el-icon-star-on','el-icon-star-on']
voidIconClass未选中 icon 的类名stringel-icon-star-off
disabledVoidIconClass只读时未选中 icon 的类名stringel-icon-star-on
showText是否显示辅助文字,若为真,则会从 texts 数组中选取当前分数对应的文字内容booleanfalse
showScore是否显示当前分数,show-score 和 show-text 不能同时为真booleanfalse
textColor辅助文字的颜色string#1F2D3D
texts辅助文字数组array['极差', '失望', '一般', '满意', '惊喜']
scoreTemplate分数显示模板string

Events

事件名称说明回调参数
change分值改变时触发改变后的分值

Released under the MIT License.