vue-paginate
vue-paginate copied to clipboard
paginated("items") returns 0 despite :list array is non-empty.
Hi
I have developed a search component which calls a 'list' component internally to show a list of results.
<list :data="searchResults" />
The data
is a computed property on list
component which either takes a data from store or from property parameter. When in the context of search , I could see that paginated('items')
returns 0 where as data exists in the list
binding variable.
How to refresh the paginated()
to reflect the correct number of items ?
I think I'm having a similar issue. My
I have the same issue.
Looking at the Vue Devtools, I see that the computed property "currentPage" is set to -1. I believe that this is the root cause of the problem.
currentPage:-1
lastPage:2
pageItemsCount:"-9-0 of 20"
I believe the easy fix is to set a watcher on the list, then run this.goToPage(1) after the update to force the current page to 1.
Someone has forked this repo and applied a fix here which works for me: https://github.com/TahaSh/vue-paginate/issues/121#issuecomment-481718494