东莞市炜创包装制品有限公司 欢迎您! 公司主营"文件资料册/卡膜保护膜/卡夹卡册/文件袋/文件夹"

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

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

 

 

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 ), ] } } })

 

posted @ 2020-05-22 14:03  会飞的小蜜蜂  阅读(5331)  评论(0编辑  收藏  举报
东莞市炜创包装制品有限公司 欢迎您! 公司主营"文件资料册/卡膜保护膜/卡夹卡册/文件袋/文件夹"