layoutchange() {
this.layout = !this.layout;
if (this.layout === true) {
this.perPage = this.layout ? 8 : 12;
this.listProducts();
} else {
this.perPage = !this.layout ? 12 : 8;
this.gridProducts();
}
},
<a class="list-icon" v-bind:class="{ active: layout == true }" v-on:click="layoutchange"></a>
<a class="grid-icon" v-bind:class="{ active: layout == false }" v-on:click="layoutchange></a>
<ul v-if="layout == true">
//code for product display
<b-pagination v-model="currentPage" :total-rows="rows" :per-page="perPage"></b-pagination>
</ul>
<ul v-if="layout == false">
//code for product display
<b-pagination v-model="currentPage" :total-rows="rows" :per-page="perPage"></b-pagination>
</ul
Essentially, my goal is to implement an API call for each page when pagination is used on my website. For example, when a user clicks on page 1 or 2, I want to trigger an API call accordingly. I am currently using the b-pagination component from Bootstrap-Vue, but I am unsure if there is an event that can be utilized to call the API for each page, such as next, previous, or any other relevant event. This way, I can seamlessly integrate API calls with pagination.
I have both grid and list view options, each with their own pagination functionality.
For more information, please refer to the documentation at