Make hasFilters computed

pull/1021/head
Cagatay Civici 2021-02-18 12:01:06 +03:00
parent 1dc969bfb1
commit 4f0e555d6d
1 changed files with 6 additions and 6 deletions

View File

@ -1372,7 +1372,7 @@ export default {
state.multiSortMeta = this.d_multiSortMeta; state.multiSortMeta = this.d_multiSortMeta;
} }
if (this.hasFilters()) { if (this.hasFilters) {
state.filters = this.filters; state.filters = this.filters;
} }
@ -1506,7 +1506,7 @@ export default {
}, },
createLazyLoadEvent(event) { createLazyLoadEvent(event) {
let filterMatchModes; let filterMatchModes;
if (this.hasFilters()) { if (this.hasFilters) {
filterMatchModes = {}; filterMatchModes = {};
this.columns.forEach(col => { this.columns.forEach(col => {
if (col.field) { if (col.field) {
@ -1526,9 +1526,6 @@ export default {
filterMatchModes: filterMatchModes filterMatchModes: filterMatchModes
}; };
}, },
hasFilters() {
return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object;
},
hasGlobalFilter() { hasGlobalFilter() {
return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global'); return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global');
}, },
@ -1626,6 +1623,9 @@ export default {
return null; return null;
}, },
hasFilters() {
return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object;
},
processedData() { processedData() {
if (this.lazy) { if (this.lazy) {
return this.value; return this.value;
@ -1641,7 +1641,7 @@ export default {
data = this.sortMultiple(data); data = this.sortMultiple(data);
} }
if (this.hasFilters()) { if (this.hasFilters) {
data = this.filter(data); data = this.filter(data);
} }