Commit b851242a authored by hetech's avatar hetech Committed by GitHub

Table: `defaultExpandAll` works when expand column exists (#14935)

* Table: `defaultExpandAll` works when expand column exists

* fix
parent d38ab315
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
}) })
} }
</tr>); </tr>);
if (this.store.isRowExpanded(row)) { if (this.hasExpandColumn && this.store.isRowExpanded(row)) {
return [ return [
tr, tr,
<tr> <tr>
...@@ -185,6 +185,10 @@ export default { ...@@ -185,6 +185,10 @@ export default {
return this.store.states.columns; return this.store.states.columns;
}, },
hasExpandColumn() {
return this.columns.some(({ type }) => type === 'expand');
},
firstDefaultColumnIndex() { firstDefaultColumnIndex() {
for (let index = 0; index < this.columns.length; index++) { for (let index = 0; index < this.columns.length; index++) {
if (this.columns[index].type === 'default') { if (this.columns[index].type === 'default') {
......
...@@ -949,7 +949,7 @@ describe('Table', () => { ...@@ -949,7 +949,7 @@ describe('Table', () => {
<template slot-scope="props"> <template slot-scope="props">
<div>{{props.row.name}}</div> <div>{{props.row.name}}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="release" label="release" /> <el-table-column prop="release" label="release" />
<el-table-column prop="director" label="director" /> <el-table-column prop="director" label="director" />
<el-table-column prop="runtime" label="runtime" /> <el-table-column prop="runtime" label="runtime" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment