vuesax
vuesax copied to clipboard
adding events to vs-pagination on goTo(page), nextPage() & prevPage()
Is there a way to add events on vs-pagination component when we click page, next and previous buttons to be able to request api calls and refresh some table data and pagination data.
Maybe adding "this.$emit('clicked')" inside goTo(page), nextPage(), prevPage() methods on vsPagination.vue, could resolve this...
You can add a watcher on the vs-pagination v-model attribute and trigger data loads when the page changes.
Hello @Cuacha07, you can use @input to watch the page change event.
<vs-pagination
:total="totalPages"
:max="6"
@input="handlePageChange"
v-model="currentPage" />
methods: {
handlePageChange (page) {
// handle the page change here!
}
}
input watch is not the right way, such functionality should have an event. i'm stuck with pagination, and I think i will not use such a library in the future, as it does not implement the basic logic for such component.
any news? I did a server side pagination with this component, however the goto field does not update the value as it navigates through the pages
1st time trying Vuesax and was stuck for an hour. At least, @input
method should be in the documentation.
And the pagination showing on mobile is like below screenscap, I think Vuesax needs some improvements.
![Screen Shot 2021-01-24 at 3 02 24 PM](https://user-images.githubusercontent.com/33022876/105625128-6387b000-5e55-11eb-861f-83595b520710.png)