Ver código fonte

修复开启TopNav后一级菜单路由参数设置无效问题(I6T1DK)

RuoYi 3 anos atrás
pai
commit
49e6fbf2ff
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      ruoyi-ui/src/components/TopNav/index.vue

+ 7 - 1
ruoyi-ui/src/components/TopNav/index.vue

@@ -127,7 +127,13 @@ export default {
127 127
         window.open(key, "_blank");
128 128
       } else if (!route || !route.children) {
129 129
         // 没有子路由路径内部打开
130
-        this.$router.push({ path: key });
130
+        const routeMenu = this.childrenMenus.find(item => item.path === key);
131
+        if (routeMenu && routeMenu.query) {
132
+          let query = JSON.parse(routeMenu.query);
133
+          this.$router.push({ path: key, query: query });
134
+        } else {
135
+          this.$router.push({ path: key });
136
+        }
131 137
         this.$store.dispatch('app/toggleSideBarHide', true);
132 138
       } else {
133 139
         // 显示左侧联动菜单