[Vuejs]-Problem with a function to filter results defined in a computed property on vue.js

0👍

Try this :

 computed: {
    filteredResources: (){
      if (!this.searchString || this.searchString == '') return this.photos;
      let regex = new RegExp(this.searchString, "i");
      return this.photos.filter(photo => regex.test(photo.title));
    }
  }

Leave a comment