[Vuejs]-Filter function shows an empty array

0👍

The match function accepts a regex, not String. Give indexOf a try:

filterProducts: function() {
   return this.products.filter(q => q.name.indexOf(this.userInput) >= 0)
}

Leave a comment