summaryrefslogtreecommitdiff
path: root/components/Pagination.vue
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-10-19 11:51:02 +0200
committerGitHub <noreply@github.com>2022-10-19 11:51:02 +0200
commita294f7d3a24546fb9d2c40ca3992ecdfc93039d8 (patch)
tree02a2181783b16029d91049f2bb2715320b0733a5 /components/Pagination.vue
parent585317bcf53db267366a64b8c896ebc52d527ee7 (diff)
Add prefetching using `nuxt-link` (#1)
Diffstat (limited to 'components/Pagination.vue')
-rw-r--r--components/Pagination.vue12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/Pagination.vue b/components/Pagination.vue
index 7925ab0..9910281 100644
--- a/components/Pagination.vue
+++ b/components/Pagination.vue
@@ -3,21 +3,21 @@
nav(aria-label="Pagination")
ul.flex.list-style-none.items-center.justify-center
li.page-item(:class="{'cursor-not-allowed opacity-20 page-item disabled': page < 1}")
- a.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
- :href="(page == 0) ? '#' : (path ?? '/')+'?page='+incrPage(-1)"
+ nuxt-link.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
+ :to="(page == 0) ? '#' : (path ?? '/')+'?page='+incrPage(-1)"
class="hover:text-gray-800 hover:bg-gray-200 focus:shadow-none dark:text-white"
)
span.sr-only Previous
svg.h-5.w-5(xmlns="http://www.w3.org/2000/svg", viewbox="0 0 20 20", fill="currentColor", aria-hidden="true")
path(fill-rule="evenodd", d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z", clip-rule="evenodd")
li.page-item(v-for="i in pages")
- a.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
- :href="(path ?? '/')+'?page='+(i-1)" aria-current="page"
+ nuxt-link.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
+ :to="(path ?? '/')+'?page='+(i-1)" aria-current="page"
:class="{'hover:text-gray-800 hover:bg-gray-200 focus:shadow-none dark:text-white': true, 'bg-green-500 text-green-50 hover:text-green-50': page == (i-1)}"
) {{ i-1 }}
li.page-item(:class="{'cursor-not-allowed opacity-20 page-item disabled': page == pages-1}")
- a.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
- :href="(page == (pages-1)) ? '#' : (path ?? '/')+'?page='+incrPage(1)"
+ nuxt-link.page-link.relative.block.py-1.px-3.rounded.border-0.bg-transparent.outline-none.transition-all.duration-300.rounded.text-gray-800(
+ :to="(page == (pages-1)) ? '#' : (path ?? '/')+'?page='+incrPage(1)"
class="hover:text-gray-800 hover:bg-gray-200 focus:shadow-none dark:text-white"
)
span.sr-only Next