I have a .vue file like below
<template>
<v-pagination
v-if="totalPage > 1"
v-model="currentPage"
:total-visible="10"
class="mt-6"
:length="totalPage"
color="#FF9A00"
></v-pagination>
</template>
<script>
export default {
data() {
return {
currentPage: this.$route.params.id ? parseInt(this.$route.params.id) : 1,
count: 100,
pageLimit: 10
}
},
computed: {
totalPage() {
return Math.ceil(this.count / this.pageLimit)
},
},
watch: {
currentPage(val) {
this.$router.push({ name: 'article-page-id', params: { id: val } })
}
},
}
</script>
But the pagination of routes depend on the watch()
. I was hoping I can make use of actual links instead so I can have my crawlers in nuxt generate
produce static HTML on the pages of these paginations as well
UPDATE:
I saw some workarounds in https://github.com/vuetifyjs/vuetify/issues/4855 but I am not quite sure where to put those workarounds.. Are they components
, plugins
? I am not sure
v-pagination
at all – Dean Christian Armada<nuxt-link :to="{name: 'name', params: $route.params.page + 1}" style: 'visibility:hidden'>$route.params.page + 1</nuxt-link>
– Dean Christian Armada