|
|
@ -1,4 +1,9 @@
|
|
|
|
import { usePageData, useRoute, useSiteDataByRoute } from 'vitepress'
|
|
|
|
import {
|
|
|
|
|
|
|
|
usePageData,
|
|
|
|
|
|
|
|
useRoute,
|
|
|
|
|
|
|
|
useSiteDataByRoute,
|
|
|
|
|
|
|
|
useSiteData
|
|
|
|
|
|
|
|
} from 'vitepress'
|
|
|
|
import { computed, h, FunctionalComponent, VNode } from 'vue'
|
|
|
|
import { computed, h, FunctionalComponent, VNode } from 'vue'
|
|
|
|
import { Header } from '../../../../types/shared'
|
|
|
|
import { Header } from '../../../../types/shared'
|
|
|
|
import { isActive, getPathDirName } from '../utils'
|
|
|
|
import { isActive, getPathDirName } from '../utils'
|
|
|
@ -9,12 +14,14 @@ const SideBarItem: FunctionalComponent<{
|
|
|
|
item: ResolvedSidebarItem
|
|
|
|
item: ResolvedSidebarItem
|
|
|
|
}> = (props) => {
|
|
|
|
}> = (props) => {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
item: { link, text, children }
|
|
|
|
item: { link: relLink, text, children }
|
|
|
|
} = props
|
|
|
|
} = props
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const route = useRoute()
|
|
|
|
const pageData = usePageData()
|
|
|
|
const pageData = usePageData()
|
|
|
|
|
|
|
|
const siteData = useSiteData()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const link = `${siteData.value.base}${relLink || ''}`
|
|
|
|
const active = isActive(route, link)
|
|
|
|
const active = isActive(route, link)
|
|
|
|
const headers = pageData.value.headers
|
|
|
|
const headers = pageData.value.headers
|
|
|
|
|
|
|
|
|
|
|
|