diff --git a/src/client/theme-default/components/NextAndPrevLinks.ts b/src/client/theme-default/components/NextAndPrevLinks.ts new file mode 100644 index 000000000000..9080a73ff9c1 --- /dev/null +++ b/src/client/theme-default/components/NextAndPrevLinks.ts @@ -0,0 +1,22 @@ +import { defineComponent, computed } from 'vue' +import { usePageData } from 'vitepress' + +export default defineComponent({ + setup() { + const pageData = usePageData() + const next = computed(() => { + return pageData.value.next + }) + const prev = computed(() => { + return pageData.value.prev + }) + const hasLinks = computed(() => { + return !!next || !!prev + }) + return { + next, + prev, + hasLinks + } + } +}) diff --git a/src/client/theme-default/components/NextAndPrevLinks.vue b/src/client/theme-default/components/NextAndPrevLinks.vue new file mode 100644 index 000000000000..f15b9b079fe7 --- /dev/null +++ b/src/client/theme-default/components/NextAndPrevLinks.vue @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/src/client/theme-default/components/Page.vue b/src/client/theme-default/components/Page.vue index c2c3536c36e4..676886eaede5 100644 --- a/src/client/theme-default/components/Page.vue +++ b/src/client/theme-default/components/Page.vue @@ -1,9 +1,17 @@ + +