Fix broken paginate links in gallery
This commit is contained in:
parent
b646efa047
commit
425fccc684
1 changed files with 5 additions and 3 deletions
|
|
@ -61,7 +61,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<PaginateLinks
|
||||
:total-pages="numberOfPages"
|
||||
:total-pages="totalPages"
|
||||
:current-page="currentPage"
|
||||
@change-page="changePage"
|
||||
/>
|
||||
|
|
@ -119,8 +119,7 @@ export default {
|
|||
return null;
|
||||
}
|
||||
},
|
||||
// name changed as paginateLinks has the prop totalPages
|
||||
numberOfPages() {
|
||||
totalPages() {
|
||||
return Math.ceil((this.all_items?.length || 0) / this.itemsPerPage);
|
||||
},
|
||||
paginatedItems() {
|
||||
|
|
@ -220,6 +219,9 @@ export default {
|
|||
}
|
||||
},
|
||||
changePage(page) {
|
||||
console.log(page);
|
||||
console.log(this.currentPage);
|
||||
console.log(this.totalPages);
|
||||
if (page >= 1 && page <= this.totalPages && this.currentPage != page) {
|
||||
this.$emit("scrollTop");
|
||||
this.currentPage = page;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue