Commit 8cc76ed9156bbb2fcc7cf51f48a700ecf97f15ea

Authored by Aresn
Committed by GitHub
2 parents c8d200da bdc80049

Merge pull request #4151 from llnewuser/2.0

toggleSelectAll method should only operate on filtered data
Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
src/components/transfer/list.vue
... ... @@ -83,10 +83,10 @@
83 83 return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
84 84 },
85 85 checkedAll () {
86   - return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
  86 + return this.filterData.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
87 87 },
88 88 checkedAllDisabled () {
89   - return this.data.filter(data => !data.disabled).length <= 0;
  89 + return this.filterData.filter(data => !data.disabled).length <= 0;
90 90 },
91 91 filterData () {
92 92 return this.showItems.filter(item => this.filterMethod(item, this.query));
... ... @@ -118,8 +118,8 @@
118 118 },
119 119 toggleSelectAll (status) {
120 120 const keys = status ?
121   - this.data.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) :
122   - this.data.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key);
  121 + this.filterData.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) :
  122 + this.filterData.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key);
123 123 this.$emit('on-checked-keys-change', keys);
124 124 },
125 125 handleQueryClear () {
... ...