update
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -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',
|
||||
}
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user