فهرست منبع

点击菜单,菜单栏隐藏

tanxue 3 سال پیش
والد
کامیت
64ddfbd5be
1فایلهای تغییر یافته به همراه25 افزوده شده و 19 حذف شده
  1. 25 19
      components/header.vue

+ 25 - 19
components/header.vue

@@ -3,27 +3,30 @@
     <div class="client-container head-layout">
       <div class="head-left">
         <a :href="`${baseUrl}`" class="client-head-img"></a>
-        <el-menu
-          :default-active="activeNav"
-          :class="navClass"
-          mode="horizontal"
-          :router="false"
-        >
-          <template v-for="(item,index) in headerArr">
-            <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
-                        popper-class="mta-menu-two">
-              <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="true" :content="child.content"></mtaLink>
+        <div @click="navChange">
+          <el-menu
+            :default-active="activeNav"
+            :class="navClass"
+            mode="horizontal"
+            :router="false"
+          >
+            <template v-for="(item,index) in headerArr">
+              <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
+                          popper-class="mta-menu-two">
+                <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="true" :content="child.content"></mtaLink>
+                </el-menu-item>
+              </el-submenu>
+
+              <el-menu-item :index="`${item.keyPath}`" v-else>
+                <mtaLink :path="item.keyPath" :instation="true" :content="item.content"></mtaLink>
               </el-menu-item>
-            </el-submenu>
+            </template>
+          </el-menu>
+        </div>
 
-            <el-menu-item :index="`${item.keyPath}`" v-else>
-              <mtaLink :path="item.keyPath" :instation="true" :content="item.content"></mtaLink>
-            </el-menu-item>
-          </template>
-        </el-menu>
         <a class="phone-tel-box mta-hidden-sm" href="tel:400-052-2130">咨询电话:400-052-2130</a>
         <!-- 手机按钮 -->
         <div class="phone-nav-btn mta-hidden-sm" @click="changeHeadNav"></div>
@@ -123,6 +126,9 @@
             this.navClass = 'head-nav-up'
         }
       },
+      navChange(){
+        this.navClass = 'head-nav-up'
+      },
     },
   };
 </script>