data中定义的列数据
columns3: [
{
title: 'Department',
dataIndex: 'department',
width: '7%',
align: 'center',
customRender: (value, row, index) => {
const obj = {
children: value,
attrs: {},
}
if (index === 0) {
obj.attrs.rowSpan = 6
}
else if(index == 1 || index == 2 || index == 3 || index==4 || index == 5 ) {
obj.attrs.rowSpan = 0
obj.attrs.colspan = 0
}
return obj
},
},
一共多少行,除了指定的行需要合并外,其他的也需要进行判断
效果图: