作者 RuoYi

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

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