dusenyao 3 年之前
父節點
當前提交
52ac426099
共有 1 個文件被更改,包括 4 次插入1 次删除
  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;
               }
             });