使用的是vxe-table的表格组件,但是项目中主要还是使用element ui的组件,如下要在vxe-table表格中添加评分组件:

vxe-table的render写法中添加element ui的组件

 

 

this.columns = [
                {
                    title: '序号',
                    type: 'seq',  
                    width: 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 ), ] } } })

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案