0👍
I suppose you should rename filteredResults
function into getFilteredResults
, add filteredResults
as an array to a data
section and in search
function do somethng like this:
<result-item
:data="filteredResults"
:total-pages="Math.ceil(filteredResults.length / 10)"
:total="filteredResults.length"
:per-page="10"
:current-page="currentPage"
@pagechanged="onPageChange"
/>
...
methods: {
search () {
this.filteredResults = this.getFilteredResults()
}
reset () {
// clear all fields here
...
this.filteredResults = []
}
}
- [Vuejs]-How to force vue to wait for async <script> to run before mounting components
- [Vuejs]-Vue.js Autocomplete
Source:stackexchange.com