mirror of https://github.com/ElemeFE/element
Table: fix toggleAllSelection bug when table is empty (#21456)
parent
d6dedac2e2
commit
d0ed7f94d6
|
@ -32,7 +32,7 @@ export const cellForced = {
|
||||||
return <el-checkbox
|
return <el-checkbox
|
||||||
disabled={ store.states.data && store.states.data.length === 0 }
|
disabled={ store.states.data && store.states.data.length === 0 }
|
||||||
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
|
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
|
||||||
nativeOn-click={ this.toggleAllSelection }
|
on-input={ this.toggleAllSelection }
|
||||||
value={ this.isAllSelected } />;
|
value={ this.isAllSelected } />;
|
||||||
},
|
},
|
||||||
renderCell: function(h, { row, column, store, $index }) {
|
renderCell: function(h, { row, column, store, $index }) {
|
||||||
|
|
|
@ -291,8 +291,7 @@ export default {
|
||||||
return classes.join(' ');
|
return classes.join(' ');
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleAllSelection(event) {
|
toggleAllSelection() {
|
||||||
event.stopPropagation();
|
|
||||||
this.store.commit('toggleAllSelection');
|
this.store.commit('toggleAllSelection');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue