We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
kiaking
brc-dd
posva
Learn more about funding links in repositories.
Report abuse
1 parent 6960ec1 commit 33962e0Copy full SHA for 33962e0
src/client/theme-default/composables/sidebar.ts
@@ -35,12 +35,19 @@ export function useSidebar() {
35
36
const isOpen = ref(false)
37
38
- const sidebar = computed(() => {
+ const _sidebar = computed(() => {
39
const sidebarConfig = theme.value.sidebar
40
const relativePath = page.value.relativePath
41
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : []
42
})
43
44
+ const sidebar = ref(_sidebar.value)
45
+
46
+ watch(_sidebar, (next, prev) => {
47
+ if (JSON.stringify(next) !== JSON.stringify(prev))
48
+ sidebar.value = _sidebar.value
49
+ })
50
51
const hasSidebar = computed(() => {
52
return (
53
frontmatter.value.sidebar !== false &&
0 commit comments