fix: 🐛 混合模式清理activeTopMenuPath缓存导致顶部菜单激活错误问题修复

This commit is contained in:
hxr committed 2024-06-25 22:55:19 +08:00
1 parent 956a3e56e6
commit 0543062363
1 file changed
+6 -1
@@ -41,9 +41,14 @@ const appStore = useAppStore();
const permissionStore = usePermissionStore(); const permissionStore = usePermissionStore();
const router = useRouter(); const router = useRouter();
// 避免 activeTopMenuPath 缓存被清理,从当前路由路径获取顶部菜单路径,eg. /system/user → /system
const activeTopMenuPath = useRoute().path.replace(/\/[^\/]+$/, "") || "/";
appStore.activeTopMenu(activeTopMenuPath);
// 激活的顶部菜单路径
const activePath = computed(() => appStore.activeTopMenuPath); const activePath = computed(() => appStore.activeTopMenuPath);
// 顶部菜单集合 // 混合模式顶部菜单集合
const mixTopMenus = ref<RouteRecordRaw[]>([]); const mixTopMenus = ref<RouteRecordRaw[]>([]);
/** /**