From e48e5d0cbc6b83a53f8217dc5e3459d81e11999a Mon Sep 17 00:00:00 2001 From: cs1707 Date: Wed, 10 Nov 2021 12:06:54 +0800 Subject: [PATCH] Table: fix toggleAllSelection bug when table is empty --- packages/table/src/config.js | 2 +- packages/table/src/table-header.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/table/src/config.js b/packages/table/src/config.js index ba705ac632..a6c8e14bf3 100644 --- a/packages/table/src/config.js +++ b/packages/table/src/config.js @@ -32,7 +32,7 @@ export const cellForced = { return 0 && !this.isAllSelected } - nativeOn-click={ this.toggleAllSelection } + on-input={ this.toggleAllSelection } value={ this.isAllSelected } />; }, renderCell: function(h, { row, column, store, $index }) { diff --git a/packages/table/src/table-header.js b/packages/table/src/table-header.js index 1d1e19dfee..f526940d5a 100644 --- a/packages/table/src/table-header.js +++ b/packages/table/src/table-header.js @@ -291,8 +291,7 @@ export default { return classes.join(' '); }, - toggleAllSelection(event) { - event.stopPropagation(); + toggleAllSelection() { this.store.commit('toggleAllSelection'); },