vuesax icon indicating copy to clipboard operation
vuesax copied to clipboard

adding events to vs-pagination on goTo(page), nextPage() & prevPage()

Open Cuacha07 opened this issue 5 years ago • 5 comments

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...

Cuacha07 avatar Apr 30 '19 19:04 Cuacha07

You can add a watcher on the vs-pagination v-model attribute and trigger data loads when the page changes.

aabiabdallah avatar May 01 '19 01:05 aabiabdallah

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!
    }
  }

renatoaguimaraes avatar May 30 '20 20:05 renatoaguimaraes

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.

abdalhadi avatar Sep 10 '20 10:09 abdalhadi

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

garbinmarcelo avatar Sep 10 '20 18:09 garbinmarcelo

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

ronaldaug avatar Jan 22 '21 10:01 ronaldaug