소스 검색

修复路由动态地址情况下菜单找不到上级菜单列表导致二级菜单不显示的 bug

yanglzh 1 개월 전
부모
커밋
26faa289e9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/layout/component/columnsAside.vue

+ 1 - 1
src/layout/component/columnsAside.vue

@@ -142,7 +142,7 @@ export default defineComponent({
     };
     // 循环引用到获取一级菜单路由
     const mathCurrentMenu = (menuList: Array<any>, path: string): any => {
-      const res = menuList.find((item: any) => item.path === path);
+      const res = menuList.find((item: any) => (item.path.includes("/:") ? path.includes(item.path.split("/:")[0]) : item.path === path));
       if (res) {
         return res;
       } else {