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

* Table: `defaultExpandAll` works when expand column exists

* fix
pull/14939/head
hetech 2019-04-02 15:26:46 +08:00 committed by GitHub
parent d38ab315fa
commit b851242a5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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 {
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') {