objectSpanMethod({ row, column, rowIndex, columnIndex }) {
for (let i = 0; i < this.mergeCell.length; i++) {
var value = this.mergeCell[i]
if (value.row == rowIndex + 1 && value.col == columnIndex) {
return {
rowspan: value.rowspan,
colspan: value.colspan
}
}
}
}
this.mergeCell存储的要合并的行列索引以及要合并的行数和列数:
[
{
row:0, //行索引
col:0, //列索引
rowspan:2, //合并的行数
colspan:0 //合并列数
}
]
之前合并功能都OK的,现在不行了,代码没变,请问是组件更新了吗或者其他问题 ?
当设置{
row:0, //行索引
col:0, //列索引
rowspan:0, //合并的行数
colspan:0 //合并列数
}时如上图,没有合并单元格,属于正常;
当设置{
row:1, //行索引
col:0, //列索引
rowspan:2, //合并的行数
colspan:0 //合并列数
}时
结果就不对了,列索引是0,但是合并的列是2