0๐
โ
I think what you want to do is following:
paginatedData() {
const start = this.pageNumber * this.size - this.size, //sets the correct start on data
end = start + this.size;
return this.listData.slice(start, end);
}
And instead of writing a different next and previous function use the @input property in the pagination.
<v-pagination v-model="pageNumber" :length="6" @input="nextPage" />
Example made out of the medium article:
https://codesandbox.io/s/charming-keldysh-8m0rk?file=/src/components/HelloWorld.vue
Source:stackexchange.com