Element: Table component BUG !!!!

Created on 22 Dec 2017  ·  1Comment  ·  Source: ElemeFE/element

在使用 table 单元格合并时,看文档上说的判断当前行和列号来 return 一个对对像,比如这样

~javascript
return {
rowspan: rowspan,
colspan: 1
};
~

但是我做来的结果是这样的

image

其中左侧的是合并了,但是右侧的 <td> 标签 并没有相应的减少。反而是增加了。而官方文档上写的取余算法也不可取(虽然是一个例子)

这个BUG不知道什么时候能解答下:

我程序代码是这样的:

~~~javascript
/**

  • 需求 :
  • 第一列能根据 goodsSpecificationsArr 数组里中长度最大的一个数组合并
  • 第二列能根据 goodsSpecificationsArr[2] 数组长度合并
    */
    objectSpanMethod({row, column, rowIndex, columnIndex}) {
    if (columnIndex === 0 && rowIndex==0) {
    var one = this.goodsSpecificationsArr[0];
    var two = this.goodsSpecificationsArr[1];
    var three = this.goodsSpecificationsArr[2];
                var rowspan = 0;
                if (!empty(three)){
                    rowspan =  three.length + 1;
                }else if (!empty(two)){
                    rowspan =  two.length + 1;
                }else{
                    return undefined;
                }

                return {
                    rowspan: rowspan,
                    colspan: 1
                };
            } else if (columnIndex === 1 && rowIndex==0) {
                var rowspan = 0;
                if (!empty(three)){
                    rowspan =  three.length;
                    return {
                        rowspan: rowspan,
                        colspan: 1
                    };
                } else{
                    return undefined;
                }
}

}
~~~

>All comments

Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.

Was this page helpful?
0 / 5 - 0 ratings