Table: fix toggleAllSelection bug when table is empty (#21456)

pull/21767/head
好多大米 2021-11-17 11:09:40 +08:00 committed by GitHub
parent d6dedac2e2
commit d0ed7f94d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -32,7 +32,7 @@ export const cellForced = {
return <el-checkbox
disabled={ store.states.data && store.states.data.length === 0 }
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
nativeOn-click={ this.toggleAllSelection }
on-input={ this.toggleAllSelection }
value={ this.isAllSelected } />;
},
renderCell: function(h, { row, column, store, $index }) {

View File

@ -291,8 +291,7 @@ export default {
return classes.join(' ');
},
toggleAllSelection(event) {
event.stopPropagation();
toggleAllSelection() {
this.store.commit('toggleAllSelection');
},