'Vue-js sliding pagination

Problem statement :

I need to make a pagination, Issue which I am facing is that next button on first page is not working. If I go to second page, the next button works perfectly.

Can someone please explain what wrong I am doing and if you can suggest some articles on the subject of pagination.

This is my HTML :

<sliding-pagination
:current="currentPage"
:total="totalPages"
@page-change="pageChangeHandler"
></sliding-pagination>

This is my Vue :

import SlidingPagination from 'vue-sliding-pagination'

// in component or vue instance
components: {
  SlidingPagination
},
data() {
  return {
    currentPage: 1,
    totalPages: 10
  }
},
methods: {
  pageChangeHandler(selectedPage) {
    this.currentPage = selectedPage
  }
}  


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source