objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
const _row = this.spanArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
getSpanArr(){
for (let i = 0; i < this.tableList.length; i++) {
if (i === 0) {
this.spanArr.push(1);
this.pos = 0
} else {
if (this.tableList[i].first === this.tableList[i - 1].first) {
this.spanArr[this.pos] += 1;
this.spanArr.push(0);
} else {
this.spanArr.push(1);
this.pos = i;
}
}
}
},
el table 合并相同数据单元格
最新推荐文章于 2024-04-07 17:19:06 发布