Skip to content

Commit

Permalink
fix: update doc footer goto function
Browse files Browse the repository at this point in the history
  • Loading branch information
elonehoo committed Oct 2, 2024
1 parent 0d6d35b commit be541ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vitepress/components/VPContentDocFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
} from '../../core'
import type { SidebarGroup } from '../config'
import { Button, Icon } from 'destyler'
import { useData } from 'vitepress'
import { useData, useRouter } from 'vitepress'
import { computed } from 'vue'
import { useConfig } from '../composables/config'
import { getSidebar } from '../support/sidebar'
Expand Down Expand Up @@ -34,6 +34,12 @@ function getFlatSideBarLinks(sidebar: SidebarGroup[]): MenuItemWithLink[] {
}
return links
}
const router = useRouter()
function goto(link: string) {
router.go(link)
}
</script>

<template>
Expand All @@ -47,6 +53,7 @@ function getFlatSideBarLinks(sidebar: SidebarGroup[]): MenuItemWithLink[] {
dark:border-white! dark:border-op-10!
hover:bg-#F4F4F5/50 dark:hover:bg-#27272A/50
group text-left"
@click="goto(links.prev.link)"
>
<div
class="
Expand All @@ -73,6 +80,7 @@ function getFlatSideBarLinks(sidebar: SidebarGroup[]): MenuItemWithLink[] {
dark:border-white! dark:border-op-10!
hover:bg-#F4F4F5/50 dark:hover:bg-#27272A/50
group text-right"
@click="goto(links.next.link)"
>
<div
class="
Expand Down

0 comments on commit be541ca

Please sign in to comment.