table列使用customRender自定义渲染多个标签
// 引入所需标签与方法
import { Tag } from 'ant-design-vue';
import { h } from 'vue';
export const columns = [
{
title: '标签',
key: 'label',
dataIndex: 'label',
align: 'center',
customRender: ({ text }) => {
const array: Array<any> = [];
text.split(',').forEach((item: string) => {
array.push(h(Tag, { color: 'blue' }, () => item));
});
return h('div', array);
},
},
];