[Vuejs]-Search through array API JSON Vue

0👍

You are not referencing the right variable in your filter function.

filteredImage: function () {
   return this.flickrImage.filter((flickrImage) => {
      return this.flickrImage.title.match(this.search)
   });
}

Should be

filteredImage: function () {
   return this.flickrImage.filter((x) => {
      return x.title.match(this.search)
   });
}

Then you just need to update your template to

<li class="media" v-for="flickrImage in filteredImage">

Here is a working JSFiddle based on yours: https://jsfiddle.net/qt8m2rwr/1/

Leave a comment