Administrator 4 лет назад
Родитель
Сommit
f9839b5c30

+ 7 - 3
src/main/resources/static/js/base.js

@@ -46,12 +46,16 @@ var globalHead = new Vue({
         articleType: '',
         topMenuList:[],
         TabList:[
-            {name:'产品',link:'/product/produce.html'},
-            {name:'仪器',link:'/product/instrument.html'}
+            {name:'产品',link:'/product/instrument.html',value:'1'},
+            {name:'仪器',link:'/product/instrument.html',value:'2'}
         ],
-        NavsList:[]
+        NavsList:[],
+        currenIndex:1
     },
     methods: {
+        changeline:function(tab){
+            this.currenIndex=tab.value;
+        },
         GetNavigationMenu :function(){//获取顶部导航分类
             var _self = this;
             PublicApi.GetNavigationMenu({},function(response){

+ 3 - 3
src/main/resources/templates/components/header.html

@@ -130,10 +130,10 @@
                 </div>
                 <div class="clsTab">
                     <div class="clsTab-main">
-                        <template v-for="(tab,i) in TabList">
-                            <a :class="{'on':i==0}" href="javascript:void(0);">
+                        <template v-for="(tab,i) in TabList" :key="i">
+                            <a :class="{'on':i==0}" href="javascript:void(0);" @click="changeline(tab)">
                                 {{tab.name}}
-                                <p :class="{'line':i==0}"></p>
+                                <p :class="tab.value==currenIndex?'line':''"></p>
                             </a>
                         </template>
                     </div>