dusenyao vor 3 Jahren
Ursprung
Commit
52ac426099
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      src/layouts/components/LayoutHeader.vue

+ 4 - 1
src/layouts/components/LayoutHeader.vue

@@ -68,6 +68,7 @@ export default {
   data() {
     return {
       activeIndex: '2', // 主导航索引
+      loginNav: 'GCLS-Learn',
       LoginNavIndex: 0, // 下拉框导航索引
       projectName: '教学中心',
       projectList: [],
@@ -116,6 +117,8 @@ export default {
       console.log(key);
       if (!key) return;
       console.log(this.LoginNavIndex);
+      console.log(this.projectList);
+      this.loginNav = key;
       this.LoginNavIndex = this.projectList.findIndex(item => item.key === key);
       console.log(this.LoginNavIndex);
     },
@@ -164,7 +167,7 @@ export default {
             this.projectList = child_sys_list;
             if (this.LoginNavIndex) return;
             this.projectList.forEach((item, index) => {
-              if (item.key === 'GCLS-Learn') {
+              if (item.key === this.loginNav) {
                 this.LoginNavIndex = index;
               }
             });