fix: pagination in vue 3
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
80163ee992
commit
4ec79f7d7e
|
@ -6,14 +6,14 @@
|
|||
v-if="totalPages > 1"
|
||||
>
|
||||
<router-link
|
||||
:disabled="currentPage === 1"
|
||||
:disabled="currentPage === 1 ? true : null"
|
||||
:to="getRouteForPagination(currentPage - 1)"
|
||||
class="pagination-previous"
|
||||
tag="button">
|
||||
{{ $t('misc.previous') }}
|
||||
</router-link>
|
||||
<router-link
|
||||
:disabled="currentPage === totalPages"
|
||||
:disabled="currentPage === totalPages ? true : null"
|
||||
:to="getRouteForPagination(currentPage + 1)"
|
||||
class="pagination-next"
|
||||
tag="button">
|
||||
|
@ -21,10 +21,10 @@
|
|||
</router-link>
|
||||
<ul class="pagination-list">
|
||||
<template v-for="(p, i) in pages">
|
||||
<li :key="'page' + i" v-if="p.isEllipsis">
|
||||
<li :key="`page-${i}-ellipsis`" v-if="p.isEllipsis">
|
||||
<span class="pagination-ellipsis">…</span>
|
||||
</li>
|
||||
<li :key="'page' + i" v-else>
|
||||
<li :key="`page-${i}-page`" v-else>
|
||||
<router-link
|
||||
:aria-label="'Goto page ' + p.number"
|
||||
:class="{ 'is-current': p.number === currentPage }"
|
||||
|
@ -100,7 +100,9 @@ export default {
|
|||
|
||||
computed: {
|
||||
pages() {
|
||||
return createPagination(this.totalPages, this.currentPage)
|
||||
const pages = createPagination(this.totalPages, this.currentPage)
|
||||
console.log(pages, this.totalPages, this.currentPage)
|
||||
return pages
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Reference in New Issue
Block a user