Explorar el Código

修复切换站点应用模块未高亮

qymljy hace 7 meses
padre
commit
258b3e912d
Se han modificado 2 ficheros con 2 adiciones y 4 borrados
  1. 0 2
      src/App.vue
  2. 2 2
      src/components/newLayout/modules/menu.vue

+ 0 - 2
src/App.vue

@@ -25,7 +25,6 @@ export default {
   },
   watch: {
     $route(val) {
-      console.log(val,'set_____________')
       this.system = JSON.parse(sessionStorage.getItem("module_info"));
       if (this.system) {
         // 假设 this.system 是一个数组,每个元素有 modules 属性,每个 module 有 apps 属性
@@ -33,7 +32,6 @@ export default {
           const md = sys.modules.find(module =>
               module.apps.some(app => app.name === val.name)
           );
-
           if (md) {
             sessionStorage.setItem("active_modules", JSON.stringify(md));
             this.$store.dispatch("setActiveApp", {

+ 2 - 2
src/components/newLayout/modules/menu.vue

@@ -3,7 +3,7 @@
     <div v-if="show">
       <el-menu
         v-if="key"
-        :default-active="activeIndex"
+        :default-active="activeIndex?activeIndex:$route.path"
         active-text-color="#3874f6"
         text-color="#333"
         class="el-menu-demo shadow"
@@ -38,7 +38,7 @@ import { mapGetters } from "vuex";
 export default {
   data() {
     return {
-      activeIndex: "2",
+      activeIndex: "",
       modules: [],
       key: Date.now(),
       show: true,