diff --git a/src/layouts/components/SubSidebar/index.vue b/src/layouts/components/SubSidebar/index.vue index 3f313d0..15defe0 100644 --- a/src/layouts/components/SubSidebar/index.vue +++ b/src/layouts/components/SubSidebar/index.vue @@ -22,18 +22,21 @@ function onSidebarScroll(e: Event) { 'shadow': sidebarScrollTop, }" /> - - - - - - + + + diff --git a/src/store/modules/menu.ts b/src/store/modules/menu.ts index d416b87..912ff7a 100644 --- a/src/store/modules/menu.ts +++ b/src/store/modules/menu.ts @@ -73,9 +73,11 @@ const useMenuStore = defineStore( } // 默认展开的导航路径 const defaultOpenedPaths = computed(() => { - let defaultOpenedPaths: string[] = [] + const defaultOpenedPaths: string[] = [] if (settingsStore.settings.app.routeBaseOn !== 'filesystem') { - defaultOpenedPaths = getDefaultOpenedPaths(sidebarMenus.value) + allMenus.value.forEach((item) => { + defaultOpenedPaths.push(...getDefaultOpenedPaths(item.children)) + }) } return defaultOpenedPaths })