修复菜单active_menu参数刷新页面后失效问题

This commit is contained in:
孟帅
2023-05-11 22:33:34 +08:00
parent f7c8092aee
commit b20bc33790
5 changed files with 32 additions and 26 deletions

View File

@@ -150,6 +150,10 @@
onMounted(() => {
updateMenu();
const matched = currentRoute.matched;
state.openKeys = matched.map((item) => item.name);
const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
selectedKeys.value = activeMenu ? (activeMenu as string) : (currentRoute.name as string);
});
return {