瀏覽代碼

注册按钮显示隐藏修改

tanxue 2 年之前
父節點
當前提交
58b81d33cd
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      components/header.vue

+ 11 - 5
components/header.vue

@@ -55,6 +55,7 @@
                 :class="navClass"
                 mode="horizontal"
                 :router="false"
+                @select="headMenuSelect"
               >
                 <template v-for="(item,index) in headerArr">
                   <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
@@ -62,13 +63,13 @@
                     <template slot="title">{{item.content}}</template>
                     <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
                                   :key="child.keyPath">
-                      <mtaLink :path="child.keyPath" :instation="false" :content="child.content" v-if="child.hrefFlag"></mtaLink>
+                      <mtaLink :path="child.keyPath" :instation="false" :content="child.content" v-if="child.hrefFlag" target="_blank"></mtaLink>
                       <mtaLink :path="child.keyPath" :instation="true" :content="child.content" v-else></mtaLink>
                     </el-menu-item>
                   </el-submenu>
 
                   <el-menu-item :index="`${item.keyPath}`" v-else>
-                    <mtaLink :path="item.keyPath" :instation="false" :content="item.content" v-if="item.hrefFlag"></mtaLink>
+                    <mtaLink :path="item.keyPath" :instation="false" :content="item.content" v-if="item.hrefFlag" target="_blank"></mtaLink>
                     <mtaLink :path="item.keyPath" :instation="true" :content="item.content" v-else></mtaLink>
                   </el-menu-item>
                 </template>
@@ -205,6 +206,13 @@
       };
     },
     methods:{
+      headMenuSelect(index){
+        if(index.indexOf('trainsystem') !== -1 || index.indexOf('examsystem') !== -1){
+          this.showBtnFlag = true;
+        }else {
+          this.showBtnFlag = false;
+        }
+      },
       // 点击按钮菜单变化
       changeHeadNav(){
           if(this.navClass ==='head-nav-up' ){
@@ -220,9 +228,7 @@
     created() {
       let str = this.$route.fullPath;
       //注意:!=-1即为为真,可以找到得情况
-      if(str.indexOf('trainsystem') !== -1){
-        this.showBtnFlag = true;
-      }else if(str.indexOf('examsystem') !== -1){
+      if(str.indexOf('trainsystem') !== -1 || str.indexOf('examsystem') !== -1){
         this.showBtnFlag = true;
       }else {
         this.showBtnFlag = false;