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