Commit 0e8bb0c195bbee63f908cfe7f2f634ff70a19beb

Authored by other
1 parent 53315dcb

更新

Showing 1 changed file with 14 additions and 1 deletions   Show diff stats
src/components/table/table-body.vue
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 @mouseleave.native.stop="handleMouseOut(row._index)" 14 @mouseleave.native.stop="handleMouseOut(row._index)"
15 @click.native="clickCurrentRow(row._index)" 15 @click.native="clickCurrentRow(row._index)"
16 @dblclick.native.stop="dblclickCurrentRow(row._index)"> 16 @dblclick.native.stop="dblclickCurrentRow(row._index)">
17 - <td v-for="column in columns" :rowspan="rowExpander(row, column)" :class="alignCls(column, row)"> 17 + <td v-for="(column,colIndex) in columns" v-if="rowExpanderResult[index][colIndex]" :rowspan="rowExpanderResult[index][colIndex]" :class="alignCls(column, row)">
18 <table-cell 18 <table-cell
19 :fixed="fixed" 19 :fixed="fixed"
20 :prefix-cls="prefixCls" 20 :prefix-cls="prefixCls"
@@ -87,6 +87,19 @@ @@ -87,6 +87,19 @@
87 } 87 }
88 } 88 }
89 return render; 89 return render;
  90 + },
  91 + rowExpanderResult() {
  92 + const result = [];
  93 + for (let i = 0; i < this.data.length; i++) {
  94 + const row = this.data[i];
  95 + const span = [];
  96 + for (let j = 0; j < this.columns.length; j++) {
  97 + const column = this.columns[j];
  98 + span.push(this.rowExpander(row,column));
  99 + }
  100 + result.push(span);
  101 + }
  102 + return result;
90 } 103 }
91 }, 104 },
92 methods: { 105 methods: {