使用的是vxe-table的表格组件,但是项目中主要还是使用element ui的组件,如下要在vxe-table表格中添加评分组件:
this.columns = [
{
title: '序号',
type: 'seq',
80
}
{
title: '满意度评价',
field: 'rateVal',
minWidth: 200,
maxWidth: 200,
cellRender: {
name: 'rateVal_1'
}
}
]
let _this = this; VXETable.renderer.mixin({ "rateVal_1": { renderDefault(h, renderOpts, params) { let { row, column } = params; return [ h('el-rate', { attrs: { value: row.rateVal, disabled: true, "disabled-void-color": "rgb(205, 205, 205)", colors: { 1: 'rgb(229, 92, 92)', 3: { value: 'rgb(255, 152, 0)', excluded: true }, 5: 'rgb(42, 139, 253)' } } }, row.rateVal ), ] } } })