// 头部合并 arraySpanMethod ({ row, column, rowIndex, columnIndex }) { let data = this.dataList let cellValue = row[column.property] if (cellValue) { // 上一条数据 let prevRow = data[rowIndex - 1] // 下一条数据 let nextRow = data[rowIndex + 1] // 当上一条数据等于下一条数据 if (prevRow && prevRow[column.property] === cellValue) { return { rowspan: 0, colspan: 0 } } else { let rowspan = 1 while (nextRow && nextRow[column.property] === cellValue) { rowspan++ nextRow = data[rowspan + rowIndex] } if (rowspan > 1) { return {rowspan, colspan: 1} } } } }