export default{ data(){ spanb:[] }},mounted:function(){ let contactDotb = 0; let spanb = []; this.data5.forEach((item,index)=>{ if(index === 0){ spanb.push(1) }else { if (item.b === this.data5[index - 1].b){ spanb[contactDotb] += 1; spanb.push(0) } else { contactDotb = index spanb.push(1) } } }) this.spanb = spanb;},methods:{ handleSpan({ row, column, rowIndex, columnIndex }){ if (columnIndex === 1) { if(this.spanb[rowIndex]){ return { rowspan:this.spanb[rowIndex], colspan:1 } }else{ return { rowspan: 0, colspan: 1 } } } if (columnIndex === 2) { if(this.spanb[rowIndex]){ return { rowspan:this.spanb[rowIndex], colspan:1 } }else{ return { rowspan: 0, colspan: 1 } } }}}