fix(菜单): 修改菜单路由未切换高亮问题
This commit is contained in:
parent
5754dd1783
commit
93661e24c8
|
@ -4,7 +4,7 @@
|
||||||
v-model:selected-keys="activeMenus"
|
v-model:selected-keys="activeMenus"
|
||||||
class="bg-transparent"
|
class="bg-transparent"
|
||||||
mode="horizontal"
|
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)">
|
<a-menu-item v-for="menu of appStore.topMenus" :key="(menu.name as string)" @click="jumpPath(menu.name)">
|
||||||
{{ t(menu.meta?.locale || '') }}
|
{{ t(menu.meta?.locale || '') }}
|
||||||
|
@ -92,6 +92,9 @@
|
||||||
function jumpPath(route: RouteRecordName | undefined) {
|
function jumpPath(route: RouteRecordName | undefined) {
|
||||||
router.push({ name: route });
|
router.push({ name: route });
|
||||||
}
|
}
|
||||||
|
function menuClickHandler() {
|
||||||
|
activeMenus.value = [appStore.getCurrentTopMenu?.name || ''];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -11,7 +11,6 @@ export default function useLeaveUnSaveTip() {
|
||||||
if (to.path === from.path) {
|
if (to.path === from.path) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(from);
|
|
||||||
openModal({
|
openModal({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: t('common.unSaveLeaveTitle'),
|
title: t('common.unSaveLeaveTitle'),
|
||||||
|
@ -24,10 +23,6 @@ export default function useLeaveUnSaveTip() {
|
||||||
onBeforeOk: async () => {
|
onBeforeOk: async () => {
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
onCancel: () => {
|
|
||||||
console.log('取消取消');
|
|
||||||
console.log(from);
|
|
||||||
},
|
|
||||||
hideCancel: false,
|
hideCancel: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue