diff --git a/src/stores/menu.ts b/src/stores/menu.ts index 02c0210..9711dcd 100644 --- a/src/stores/menu.ts +++ b/src/stores/menu.ts @@ -40,18 +40,8 @@ export const useMenuStore = defineStore('menu', () => { } const toggleSidebarDesktop = () => (sidebarShowed.value = !sidebarShowed.value) - watch(router, (value) => { - if (value.currentRoute.value.fullPath === '/' || value.currentRoute.value.fullPath === '/home') { - for (const item of navigation.value) { - item.expanded = false - } - } - }) - watch(menuSelected, (value) => { if (value !== '/login' && value !== '/404' && value !== '/home' && value !== '/') { - console.log('current route', value); - const result = command.searchRoutesPath(routes, value) if (result.length > 0) { const route = result.find((item) => item.path === value) @@ -59,7 +49,12 @@ export const useMenuStore = defineStore('menu', () => { command.addRecent(route) } } - + } else { + if (value === '/' || value === '/home') { + for (const item of navigation.value) { + item.expanded = false + } + } } }) diff --git a/vite.config.ts b/vite.config.ts index 6c8dc64..e90681d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,7 +18,8 @@ export default defineConfig({ ], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) + '@': fileURLToPath(new URL('./src', import.meta.url)), + 'inferno': 'inferno/dist/index.dev.esm.js', } }, })