Fix broken paginate links in gallery

This commit is contained in:
Julian Stirling 2026-05-15 10:30:59 +01:00
parent b646efa047
commit 425fccc684

View file

@ -61,7 +61,7 @@
</div> </div>
</div> </div>
<PaginateLinks <PaginateLinks
:total-pages="numberOfPages" :total-pages="totalPages"
:current-page="currentPage" :current-page="currentPage"
@change-page="changePage" @change-page="changePage"
/> />
@ -119,8 +119,7 @@ export default {
return null; return null;
} }
}, },
// name changed as paginateLinks has the prop totalPages totalPages() {
numberOfPages() {
return Math.ceil((this.all_items?.length || 0) / this.itemsPerPage); return Math.ceil((this.all_items?.length || 0) / this.itemsPerPage);
}, },
paginatedItems() { paginatedItems() {
@ -220,6 +219,9 @@ export default {
} }
}, },
changePage(page) { changePage(page) {
console.log(page);
console.log(this.currentPage);
console.log(this.totalPages);
if (page >= 1 && page <= this.totalPages && this.currentPage != page) { if (page >= 1 && page <= this.totalPages && this.currentPage != page) {
this.$emit("scrollTop"); this.$emit("scrollTop");
this.currentPage = page; this.currentPage = page;