fix(菜单): 修改菜单路由未切换高亮问题

This commit is contained in:
xinxin.wu 2023-08-25 10:21:33 +08:00 committed by 刘瑞斌
parent 5754dd1783
commit 93661e24c8
2 changed files with 4 additions and 6 deletions

View File

@ -4,7 +4,7 @@
v-model:selected-keys="activeMenus"
class="bg-transparent"
mode="horizontal"
@menu-item-click="setCurrentTopMenu"
@menu-item-click="menuClickHandler"
>
<a-menu-item v-for="menu of appStore.topMenus" :key="(menu.name as string)" @click="jumpPath(menu.name)">
{{ t(menu.meta?.locale || '') }}
@ -92,6 +92,9 @@
function jumpPath(route: RouteRecordName | undefined) {
router.push({ name: route });
}
function menuClickHandler() {
activeMenus.value = [appStore.getCurrentTopMenu?.name || ''];
}
</script>
<style lang="less" scoped></style>

View File

@ -11,7 +11,6 @@ export default function useLeaveUnSaveTip() {
if (to.path === from.path) {
return;
}
console.log(from);
openModal({
type: 'error',
title: t('common.unSaveLeaveTitle'),
@ -24,10 +23,6 @@ export default function useLeaveUnSaveTip() {
onBeforeOk: async () => {
next();
},
onCancel: () => {
console.log('取消取消');
console.log(from);
},
hideCancel: false,
});
});