Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paginated("items") returns 0 despite :list array is non-empty. #123

Open
paragdiwan opened this issue May 21, 2019 · 3 comments
Open

paginated("items") returns 0 despite :list array is non-empty. #123

paragdiwan opened this issue May 21, 2019 · 3 comments

Comments

@paragdiwan
Copy link

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 ?

@felipecarmomps
Copy link

I think I'm having a similar issue. My component starts with a ":list" prop assigned to a computed variable that is an empty array from "vuex", after I add the first element to it instead of starting showing the list "paginated()" keeps returning an empty array, I have to refresh the page to "fix" it.

@marcioelias
Copy link

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"

@spacewaffle
Copy link

spacewaffle commented Apr 2, 2020

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:
#121 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants