兰宝车间质量管理系统-前端
LiuHao
2023-05-05 ec29c057c4a283127fe5f09b7c4b52b5195e5ca1
修复开启TopNav后一级菜单路由参数设置无效问题
已修改2个文件
11 ■■■■ 文件已修改
src/components/TopNav/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/types/router.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/TopNav/index.vue
@@ -104,7 +104,7 @@
  visibleNumber.value = parseInt(String(width / 85));
}
const handleSelect = (key: string, keyPath: string[]) => {
const handleSelect = (key: string) => {
  currentIndex.value = key;
  const route = routers.value.find(item => item.path === key);
  if (isHttp(key)) {
@@ -112,7 +112,13 @@
    window.open(key, "_blank");
  } else if (!route || !route.children) {
    // 没有子路由路径内部打开
    router.push({ path: key, fullPath: '' });
    const routeMenu = childrenMenus.value.find(item => item.path === key);
    if (routeMenu && routeMenu.query) {
      let query = JSON.parse(routeMenu.query);
      router.push({ path: key, query: query });
    } else {
      router.push({ path: key });
    }
    appStore.toggleSideBarHide(true);
  } else {
    // 显示左侧联动菜单
src/types/router.d.ts
@@ -13,6 +13,7 @@
      title: string;
      icon: string;
    };
    query?: string;
  } & RouteRecordRaw;
  interface _RouteLocationBase {