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>
|
||||||
</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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue