pull/3621/merge
Shyam Chen 1 year ago committed by GitHub
commit 7d5f92ea6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -97,8 +97,8 @@ function onCaretClick() {
<div v-if="item.items && item.items.length" class="items"> <div v-if="item.items && item.items.length" class="items">
<template v-if="depth < 5"> <template v-if="depth < 5">
<VPSidebarItem <VPSidebarItem
v-for="i in item.items" v-for="(i, j) in item.items"
:key="i.text" :key="`${depth}-${j}`"
:item="i" :item="i"
:depth="depth + 1" :depth="depth + 1"
/> />

@ -7,7 +7,6 @@ import {
ref, ref,
watch, watch,
watchEffect, watchEffect,
watchPostEffect,
type ComputedRef, type ComputedRef,
type Ref type Ref
} from 'vue' } from 'vue'
@ -175,9 +174,15 @@ export function useSidebarControl(
collapsed.value = !!(collapsible.value && item.value.collapsed) collapsed.value = !!(collapsible.value && item.value.collapsed)
}) })
watchPostEffect(() => { watch(
;(isActiveLink.value || hasActiveLink.value) && (collapsed.value = false) item,
}) () => {
if (isActiveLink.value || hasActiveLink.value) {
collapsed.value = false
}
},
{ immediate: true, deep: true }
)
function toggle() { function toggle() {
if (collapsible.value) { if (collapsible.value) {

Loading…
Cancel
Save