dataIndex 文本
{
title: "title",
dataIndex: "title",
},
customRender 插槽:选择性文本
{
title: "sex",
dataIndex: "sex",
customRender: (text, row, index) => {
switch (text) {
case '1':
return 'male';
case '0':
return 'female';
default:
return 'unknown';
}
}
},
scopedSlots 传递
{
title: "operation",
dataIndex: 'operation',
width: "120px",
fixed: "right",
scopedSlots: { customRender: 'operation' }
}
传递单个column,定义模块 slot接受的值operation
<template slot="operation" slot-scope="record">
<a class="edit" @click="() => do(record)">
点击传递单行column
</a>
</template>