mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
1a7b570c82
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
46 lines
799 B
Vue
46 lines
799 B
Vue
<template>
|
|
<AppPage>
|
|
<PageContent :page="page" />
|
|
<template #prev-next>
|
|
<PagePrevNext :prev="prev" :next="next" />
|
|
</template>
|
|
</AppPage>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
defineComponent,
|
|
ref,
|
|
useContext,
|
|
useFetch
|
|
} from '@nuxtjs/composition-api'
|
|
export default defineComponent({
|
|
props: {
|
|
page: {
|
|
type: Object,
|
|
required: true
|
|
}
|
|
},
|
|
setup (props) {
|
|
const { $docus } = useContext()
|
|
const prev = ref(null)
|
|
const next = ref(null)
|
|
useFetch(async () => {
|
|
const [prevLink, nextLink] = await $docus.getPreviousAndNextLink(
|
|
props.page
|
|
)
|
|
prev.value = prevLink
|
|
next.value = nextLink
|
|
})
|
|
return {
|
|
prev,
|
|
next
|
|
}
|
|
},
|
|
templateOptions: {
|
|
aside: true,
|
|
fluid: false
|
|
}
|
|
})
|
|
</script>
|