Skip to content

Commit

Permalink
fix(sidebar.): watch item deep
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Mar 8, 2024
1 parent 9a479f2 commit 7bedf9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/client/theme-default/composables/sidebar.ts
Expand Up @@ -176,6 +176,14 @@ export function useSidebarControl(
collapsed.value = !!(collapsible.value && item.value.collapsed)
})

watch(
item,
() => {
;(isActiveLink.value || hasActiveLink.value) && (collapsed.value = false)
},
{ deep: true, flush: 'post' }
)

watchPostEffect(() => {
;(isActiveLink.value || hasActiveLink.value) && (collapsed.value = false)
})
Expand Down

0 comments on commit 7bedf9c

Please sign in to comment.