vue-paginate
vue-paginate copied to clipboard
page is not selected when the array changes the values
Is my pug code `
paginate.ptb-0.col-sm-12( name="empresas" :list="empresas" :per="10" )
`.col-sm-4.card-col(v-for='empresa in paginated("empresas")', :key='empresa.id', if='empresa.attributes.ativada')` div(@click='openVizualizarEmpresa(empresa.id)', v-if='empresa.attributes.ativada')`
Cards(:empresa='empresa.attributes')
paginate-links(for="empresas", :async='true')`
Configuration
import VuePaginate from 'vue-paginate' vue.use(VuePaginate)
data () { return { paginate: ['empresas'] } }
I make several filters in this array and it constantly changes, when it is empty according to the filter, the paginate does not show anything (it's right), however when I take the filter and the array takes the elements back, the paginate receives the elements of the array, but it does not select page 1
I try make a watch in this array and call goToPage(1) method to select a page, but it returns this error: [vue-paginate]: You cannot go to page 1. The last page is 0.
@TahaSh @callumacrae @extend1994 @deohnas
This is indeed a bug that was introduced with v3.6.0.
I have created a pull request to fix this issue: #95
Ok, thanks. When they merge this pull Request? @patrickkivits
No idea, that is up to @TahaSh
In the meantime im just using my own repo in package.json:
"vue-paginate": "https://github.com/patrickkivits/vue-paginate/tarball/master"
Sorry guys for the late response. This should be merged very soon because I'm planning to go through the PRs for the next release.
I referenced your fork in my package.json and it worked. @patrickkivits
Having the same problem here.
Any updates?
@rassemdev i'm wait too, for now i did a fork, if your problem is very emergency, i advise you do the same
@MateusSilveira98 i dont know how to do it.
I think this is the same issue I'm having. I've made a reproduction specific to my case:
https://jsfiddle.net/rpemberton/L6o1uryb/
When you search for something that doesn't exist, and then the remove the search term, the list doesn't appear again.
The reason is that currentPage
changes to -1
and doesn't change back to a natural number.
My quick fix is to simply change this if statement:
https://github.com/TahaSh/vue-paginate/blob/fcff039e90c9e3be5fbc091a47bf67d467fc3cd1/src/components/Paginate.js#L75
to if (this.currentPage >= this.lastPage && this.lastPage) {
This is an issue for me as well. Any word?
Sorry to repeat, but when is this being fixed?
I have also created a snippet: https://jsfiddle.net/rpemberton/L6o1uryb/ And searching for inexistent values and clearing the search leaves the list blank.
For example, searching for 'a' OR 'q' recreates this bug.
Downgrade to 3.5.0
, until merge. It's exactly as @patrickkivits says
Any updates on this? I am experiencing the same issue on version 3.5.0