Compare commits

...

2 commits

View file

@ -77,17 +77,12 @@
<a class="pagination-next" :class="{'is-disabled': !total || (page*limit) >= total}" @click="next">Suivant</a>
<ul class="pagination-list">
<template v-for="p in Array.from({length: totalPages}, (v, i) => (i+1))">
<template v-if="page >= 8 && p === 4">
<li>
<a class="pagination-link is-disabled">…</a>
</li>
</template>
<template v-if="p <= 3 || p > (totalPages - 3) || (p >= (page - 3) && p <= (page + 3))">
<template v-if="p < 4 || p > (totalPages - 3) || (page - 3) <= p && page + 3 >= p">
<li>
<a class="pagination-link" :class="{'is-current': p === page}" @click="goTo(p)" aria-label="Aller à la page {{p}}">{{ p }}</a>
</li>
</template>
<template v-if="page >= 8 && p === totalPages - 4 && page <= totalPages - 7">
<template v-if="(page - 3 - 1 === p && page - 4 > 3) || (page + 4 === p && page + 3 < totalPages - 3)">
<li>
<a class="pagination-link is-disabled">…</a>
</li>