Search code examples
jquerypaginationvue.jsvue-resource

pagination with filter in vueJs


I have found code in here

v-for="rowinvitation in viewListInvitation | sourceInvitation | limitBy count offset"

but I found error, when I click last page & I find in page one, he is error.

for ex: I have click page 9 in pagination & I find "Kathy". in paginate displaying -3,-2-1,0 & nothing result,

How I can find "Kathy" when condition in last page "9"


Solution

  • This is because your items has changed; in this case, becoming less.

    You'll should watch for items changes, and call the update method to reset the active page parameter, so we can jump back to first page.

    Add the below codes in your paging component and it should do the trick:

            watch: {
                'items': function(){
                    this.update(0);
                }
            },