Answer the question
In order to leave comments, you need to log in
How can I filter data by multiple values?
Everything works for me if there is one filtering, but if several are done, then which upper filtering does it prevail over the lower one, how can I roughly make it take into account the data that comes from two filters?
https://codesandbox.io/s/pyvjxxnnvj
The code where the data is filtered is in App.vue:212 in the computed employeeList
Answer the question
In order to leave comments, you need to log in
employeeList: function() {
return this.items.filter(item =>
Object.keys(this.filterItems).reduce((acc, filterKey) => {
let filterCondition = this.filterItems[filterKey];
return acc && !!~item[filterKey].indexOf(filterCondition);
}, true)
).sort(....);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question