表格bodyCell响应式处理,划入列展示tooltip文字
//表格优化
bodyCell(column) {
if(column.column?.key!=='operation'){
column.column.width = 'auto';
}
if(column.column.render){
const cellRender = column.column.render.bind(this)
return (
<antTooltip title={column.column?.key!=='operation'&&column?.value}>
<p>
{cellRender(column.value, column.record, column.index)}
</p>
</antTooltip>
)
}else{
return (
<antTooltip title={column?.value}>
<p>
<span>
{column?.value}
</span>
</p>
</antTooltip>
)
}
}
<antTable
v-slots={{
bodyCell: this.bodyCell
}}
></antTable>