[Vuejs]-Vue.js pagination with http requests

0๐Ÿ‘

โœ…

Ok, I found a solution by myself. First, it is necessary to use pagination
instead of pagination-nav. And add event listener @change

<b-pagination
  v-model="currentPage"
  :total-rows="rows"
  :per-page="perPage"
  first-text="First"
  prev-text="Prev"
  next-text="Next"
  last-text="Last"
  @change="loadPage"
></b-pagination>

Second, in callback function loadPage we use a page number passed from button to get necessary part of data from API.

loadPage(pageNum) {
  this.getTrades(pageNum);
},

Leave a comment