1. 使用customRender引入插槽
scopedSlots: { customRender: 'action' }
2. 使用customRender指定渲染内容
columns: [
{
title: '类型',
dataIndex: 'type',
customRender: (text, record) => {
console.log(record)
if (text === 0) {
return '客户1'
} else if (text === 1) {
return '客户2'
} else if (text === 2) {
return '客户3'
}
}
}
]
注意:text参数为当前行的值;record参数为当前行数据