Blogger Information
Blog 47
fans 0
comment 2
visits 102823
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
iview的table合并相同的单元格
拾一枝樱花的博客
Original
2092 people have browsed it

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            }        }    }}}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post