checkbox‘s status is also depends on filtered data

This commit is contained in:
llnewuser 2018-07-30 15:59:25 +08:00
parent 19183ec23c
commit bdc8004918

View file

@ -83,10 +83,10 @@
return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`; return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`;
}, },
checkedAll () { checkedAll () {
return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; return this.filterData.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0;
}, },
checkedAllDisabled () { checkedAllDisabled () {
return this.data.filter(data => !data.disabled).length <= 0; return this.filterData.filter(data => !data.disabled).length <= 0;
}, },
filterData () { filterData () {
return this.showItems.filter(item => this.filterMethod(item, this.query)); return this.showItems.filter(item => this.filterMethod(item, this.query));