element-ui表格行合並


arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
let lengthList = [
{ len: 2, startIndex: 0 },
{ len: 3, startIndex: 0 },
{ len: 4, startIndex: 0 },
{ len: 5, startIndex: 0 }
]
const lastIndex = 5
let sum = 0
lengthList.forEach(item => {
item.startIndex = sum
sum += item.len
})
let getSign = false
for (var i = 0; i < lengthList.length; i++) {
if (rowIndex == lengthList[i].startIndex) {
getSign = true
return {
rowspan: lengthList[i].len,
colspan: 1
};
}
}
if (!getSign) {
return {
rowspan: 0,
colspan: 0
}
}
}
},


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM