Преглед на файлове

开启TopNav没有子菜单隐藏侧边栏

RuoYi преди 3 години
родител
ревизия
d2bd73b4dc
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      ruoyi-ui/src/components/TopNav/index.vue

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

@@ -92,7 +92,9 @@ export default {
92 92
       if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) {
93 93
         const tmpPath = path.substring(1, path.length);
94 94
         activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
95
-        this.$store.dispatch('app/toggleSideBarHide', false);
95
+        if (!this.$route.meta.link) {
96
+          this.$store.dispatch('app/toggleSideBarHide', false);
97
+        }
96 98
       } else if(!this.$route.children) {
97 99
         activePath = path;
98 100
         this.$store.dispatch('app/toggleSideBarHide', true);
@@ -145,6 +147,8 @@ export default {
145 147
       }
146 148
       if(routes.length > 0) {
147 149
         this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
150
+      } else {
151
+        this.$store.dispatch('app/toggleSideBarHide', true);
148 152
       }
149 153
     },
150 154
     ishttp(url) {