mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-02 19:08:40 +08:00
fix(Menu): 左侧菜单混合模式 在动态更改路由时,左侧显示的菜单没有实时更新
This commit is contained in:
parent
5225345496
commit
5c491a4258
@ -80,13 +80,14 @@
|
||||
<script lang="ts">
|
||||
import type { Menu } from '/@/router/types';
|
||||
import type { CSSProperties } from 'vue';
|
||||
import { computed, defineComponent, onMounted, ref, unref } from 'vue';
|
||||
import { computed, defineComponent, onMounted, ref, unref, watch } from 'vue';
|
||||
import type { RouteLocationNormalized } from 'vue-router';
|
||||
import { ScrollContainer } from '/@/components/Container';
|
||||
import { SimpleMenu, SimpleMenuTag } from '/@/components/SimpleMenu';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { AppLogo } from '/@/components/Application';
|
||||
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
|
||||
import { usePermissionStore } from '/@/store/modules/permission';
|
||||
import { useDragLine } from './useLayoutSider';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
@ -138,6 +139,7 @@
|
||||
} = useMenuSetting();
|
||||
|
||||
const { title } = useGlobSetting();
|
||||
const permissionStore = usePermissionStore();
|
||||
|
||||
useDragLine(sideRef, dragBarRef, true);
|
||||
|
||||
@ -191,6 +193,17 @@
|
||||
menuModules.value = await getShallowMenus();
|
||||
});
|
||||
|
||||
// Menu changes
|
||||
watch(
|
||||
[() => permissionStore.getLastBuildMenuTime, () => permissionStore.getBackMenuList],
|
||||
async () => {
|
||||
menuModules.value = await getShallowMenus();
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
|
||||
listenerRouteChange((route) => {
|
||||
currentRoute.value = route;
|
||||
setActive(true);
|
||||
|
Loading…
Reference in New Issue
Block a user