[Vuejs]-Vue.js – Filter multiple fields

3👍

I think this is what you’re looking for

filteredProducts () {
  let results = this.products
  if(this.filters.appointments.length) {
    results = results.filter(logicFilterHere)
  }
  if(this.filters.powers.length) {
    results = results.filter(logicFilterHere)
  }
  if(this.filters.materials.length) {
    results = results.filter(logicFilterHere)
  }
  return results
}

Leave a comment