Here is how my Vue component looks like:
<template>
...
<b-col v-for="item in items"
v-bind:key="item.id"
cols="2">
...
<strong slot="header" class="text-dark" :title="item.tittle" >{{item.tittle}}</strong><br/>
...
<strong class="bg-warning text-dark"><i class="fa fa-money"></i> <b>{{item.price}}</b></strong><br/>
...
</b-col>
...
<b-pagination size="sm" :total-rows="itemsPagination.total" :per-page="itemsPagination.per_page" v-model="itemsPagination.current_page" prev-text="Prev" next-text="Next" hide-goto-end-buttons/>
...
</template>
<script>
export default {
...
data () {
return{
items: '',
itemsPagination: ''
}
},
mounted: function () {
this.getItems()
},
methods: {
getItems() {
let params = []
...
let request = new Request(ApiUrls.items + '?' + params.join('&'), {
method: 'GET',
headers: new Headers({
'Authorization': 'bearer ' + this.$session.get(SessionKeys.ApiTokens),
'Content-Type': 'text/plain'
})
})
fetch(request).then(r=> r.json())
.then(r=> {
this.items = r.data
this.itemsPagination = r
})
.catch(e=>console.log(e))
}
}
}
</script>
Upon
console.log(this.itemsPagination)
, the output in browser console appears as shown below:
https://i.sstatic.net/PqOnb.png
This is how the pagination looks on my application interface:
https://i.sstatic.net/QtoKA.png
After executing the script, the item content on page 1 displays correctly. However, switching to subsequent pages does not update the item content. I'm struggling to resolve this issue and make it function properly.
Any suggestions on how to address this problem?
Update
I am using CoreUI
https://github.com/coreui/coreui-free-vue-admin-template/blob/master/src/views/base/Paginations.vue