fix(菜单): 修改菜单路由未切换高亮问题
This commit is contained in:
parent
5754dd1783
commit
93661e24c8
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue