{
title: '操作',
width: 200,
align: 'center',
fixed: 'right',
render: (h, params) => {
const { row, row: { id } } = params;
let status = true;
let color = 'blue';
let text = '默认(操作)';
switch (params.row.status + '') {
case '1':
status = true;
color = 'blue';
break;
case '2':
status = false;
color = '#cccccc';
break;
default:
color = 'blue';
}
return (
<div>
<span class="button-pre color-blue" onClick={() => this.handleCreate('checkDistinctRule', params.row)}>查看</span>
<span class="button-pre color-{color}" onClick={() => this.handleCreate('editDistinctRule', params.row)}>变更</span>
<span class="button-pre color-blue" onClick={() => this.handleCreate('historyDistinctRule', params.row)}>变更记录</span>
<i-switch style="margin-left:8px" size="small" v-model={status} onOn-change={() => this.handleChangeStatus(params.row)}></i-switch>
</div>
);
}
[iview]Table中使用Switch-标签写法
最新推荐文章于 2023-10-16 11:57:48 发布