|
|
@ -1,5 +1,5 @@
|
|
|
|
import { Ref, ref, computed, watchEffect, onMounted, onUnmounted } from 'vue'
|
|
|
|
import { computed, onMounted, onUnmounted, Ref, ref, watchEffect } from 'vue'
|
|
|
|
import { useRoute, useData } from 'vitepress'
|
|
|
|
import { useData, useRoute } from 'vitepress'
|
|
|
|
import { getSidebar } from '../support/sidebar'
|
|
|
|
import { getSidebar } from '../support/sidebar'
|
|
|
|
|
|
|
|
|
|
|
|
export function useSidebar() {
|
|
|
|
export function useSidebar() {
|
|
|
@ -10,9 +10,7 @@ export function useSidebar() {
|
|
|
|
|
|
|
|
|
|
|
|
const sidebar = computed(() => {
|
|
|
|
const sidebar = computed(() => {
|
|
|
|
const sidebarConfig = theme.value.sidebar
|
|
|
|
const sidebarConfig = theme.value.sidebar
|
|
|
|
const relativePath = route.data.relativePath
|
|
|
|
return sidebarConfig ? getSidebar(sidebarConfig, route.path) : []
|
|
|
|
|
|
|
|
|
|
|
|
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : []
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const hasSidebar = computed(() => {
|
|
|
|
const hasSidebar = computed(() => {
|
|
|
|