diff --git a/src/client/theme-default/composables/sidebar.ts b/src/client/theme-default/composables/sidebar.ts index 4d98edfc..ddc9c073 100644 --- a/src/client/theme-default/composables/sidebar.ts +++ b/src/client/theme-default/composables/sidebar.ts @@ -35,12 +35,19 @@ export function useSidebar() { const isOpen = ref(false) - const sidebar = computed(() => { + const _sidebar = computed(() => { const sidebarConfig = theme.value.sidebar const relativePath = page.value.relativePath return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [] }) + const sidebar = ref(_sidebar.value) + + watch(_sidebar, (next, prev) => { + if (JSON.stringify(next) !== JSON.stringify(prev)) + sidebar.value = _sidebar.value + }) + const hasSidebar = computed(() => { return ( frontmatter.value.sidebar !== false &&