[Vuejs]-Vue displaying array elements via search on button click

0👍

You should use computed property to filter out results you fetched in mounted hook. You can check out vue.js documentation example with similar functionality here – https://v2.vuejs.org/v2/guide/list.html#v-for-with-a-Component.

If you want to make separate API call for every search request, then just implement search method and use your this.creditid as parameter and replace credits array with API response data – example https://jsfiddle.net/qrwn568g/1/ (added axios for http request handling and tailwind for a little styling)

Leave a comment