{
title: "开关",
key: "paramState",
align: "center",
ellipsis: true,
tooltip: true,
width: '140px',
render: function (h, params) {
var value = 2;
return h('div', [
h('i-switch', { //数据库1是已处理,0是未处理
props: {
type: 'primary',
value: value === 1 //控制开关的打开或关闭状态,官网文档属性是value
},
style: {
marginRight: '5px'
},
on: {
'on-change': (value) => { //触发事件是on-change,用双引号括起来,
//参数value是回调值,并没有使用到
this.switch(params.index) //params.index是拿到table的行序列,可以取到对应的表格值
}
}
}, )
])
}
}