|
|
@@ -162,7 +162,7 @@ const handleMenu = () => {
|
|
|
}
|
|
|
|
|
|
function menuClick(value: any) {
|
|
|
- router.push(value.key);
|
|
|
+ router.push({ name: value.key });
|
|
|
}
|
|
|
// 一级菜单图标
|
|
|
function fontIcon(code: string): string {
|
|
|
@@ -259,13 +259,26 @@ export default defineComponent({
|
|
|
// 处理路由跳转到菜单栏里第一个对应的页面
|
|
|
const list = unref(menuList);
|
|
|
if (list.length && list[0].children && list[0].children.length) {
|
|
|
- const code = list[0].children[0].code;
|
|
|
+ // 处理修改具体某个菜单栏,主要处理页面刷新
|
|
|
+ let firstIndex = 0,
|
|
|
+ secondeIndex = 0;
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ for (let j = 0; j < list[i].children.length; j++) {
|
|
|
+ if (window.location.hash.includes(list[i].children[j].code)) {
|
|
|
+ firstIndex = i;
|
|
|
+ secondeIndex = j;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const code = list[firstIndex].children[secondeIndex].code;
|
|
|
selectedKeys.value = [code];
|
|
|
- openKeys.value = [list[0].code];
|
|
|
+ openKeys.value = [list[firstIndex].code];
|
|
|
context.emit('chooseMenu', setShowBottomPart(code));
|
|
|
// 处理页面刷新时候 引发路由乱跳的bug
|
|
|
if (router.currentRoute.value.fullPath === '/home') {
|
|
|
router.push(code);
|
|
|
+ } else {
|
|
|
}
|
|
|
}
|
|
|
});
|