fix: fix next and prev links not working when the `base` option is set (#139)

pull/141/head
Máximo Mussini 5 years ago committed by GitHub
parent ac5fbec7d7
commit 018a9b46d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,13 +2,13 @@
<div v-if="hasLinks" class="next-and-prev-link"> <div v-if="hasLinks" class="next-and-prev-link">
<div class="container"> <div class="container">
<div class="prev"> <div class="prev">
<a v-if="prev" class="link" :href="prev.link"> <a v-if="prev" class="link" :href="withBase(prev.link)">
<ArrowLeft class="icon icon-prev" /> <ArrowLeft class="icon icon-prev" />
<span class="text">{{ prev.text }}</span> <span class="text">{{ prev.text }}</span>
</a> </a>
</div> </div>
<div class="next"> <div class="next">
<a v-if="next" class="link" :href="next.link"> <a v-if="next" class="link" :href="withBase(next.link)">
<span class="text">{{ next.text }}</span> <span class="text">{{ next.text }}</span>
<ArrowRight class="icon icon-next" /> <ArrowRight class="icon icon-next" />
</a> </a>
@ -20,6 +20,7 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
import { useNextAndPrevLinks } from '../composables/nextAndPrevLinks' import { useNextAndPrevLinks } from '../composables/nextAndPrevLinks'
import { withBase } from '../utils'
import ArrowLeft from './icons/ArrowLeft.vue' import ArrowLeft from './icons/ArrowLeft.vue'
import ArrowRight from './icons/ArrowRight.vue' import ArrowRight from './icons/ArrowRight.vue'
@ -35,7 +36,8 @@ export default defineComponent({
return { return {
hasLinks, hasLinks,
prev, prev,
next next,
withBase,
} }
} }
}) })

Loading…
Cancel
Save