|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
- <div :class="['nav-comp',activeClass]">
|
|
|
+ <div :class="['nav-comp',activeTabObj.classVal]">
|
|
|
<div class="header">
|
|
|
<i class="home-btn iconfont icon-home"></i>
|
|
|
- <div class="title">{{titleText}}</div>
|
|
|
+ <div class="title">{{activeTabObj.name}}</div>
|
|
|
</div>
|
|
|
<div class="nav">
|
|
|
<ul>
|
|
|
- <li :class="{'active':item.id == activeTab}" v-for="item in tabBtn" :key="item.id" @touchstart="goPage(item.path,item.id)">
|
|
|
+ <li :class="{'active':item.id == val}" v-for="item in tabBtn" :key="item.id" @touchstart="goPage(item.path,item.id)">
|
|
|
<i :class="['iconfont',item.icon]"></i>
|
|
|
<span>{{item.name}}</span>
|
|
|
</li>
|
|
@@ -61,25 +61,40 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ props:{
|
|
|
+ val:{
|
|
|
+ type:String,
|
|
|
+ default:"1001"
|
|
|
+ }
|
|
|
+ },
|
|
|
computed:{
|
|
|
- titleText(){
|
|
|
- let _thisVal = "";
|
|
|
- this.tabBtn.forEach(val => {
|
|
|
- if(val.id == this.activeTab){
|
|
|
- _thisVal = val.name;
|
|
|
- }
|
|
|
- });
|
|
|
- return _thisVal;
|
|
|
- },
|
|
|
- activeClass(){
|
|
|
- let _thisVal = "";
|
|
|
+ activeTabObj(){
|
|
|
+ let _thisVal = {}
|
|
|
this.tabBtn.forEach(val => {
|
|
|
- if(val.id == this.activeTab){
|
|
|
- _thisVal = val.classVal;
|
|
|
+ if(val.id == this.val){
|
|
|
+ _thisVal = val;
|
|
|
}
|
|
|
});
|
|
|
return _thisVal;
|
|
|
}
|
|
|
+ // titleText(){
|
|
|
+ // let _thisVal = "";
|
|
|
+ // this.tabBtn.forEach(val => {
|
|
|
+ // if(val.id == this.activeTab){
|
|
|
+ // _thisVal = val.name;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return _thisVal;
|
|
|
+ // },
|
|
|
+ // activeClass(){
|
|
|
+ // let _thisVal = "";
|
|
|
+ // this.tabBtn.forEach(val => {
|
|
|
+ // if(val.id == this.activeTab){
|
|
|
+ // _thisVal = val.classVal;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // return _thisVal;
|
|
|
+ // }
|
|
|
},
|
|
|
methods: {
|
|
|
goPage(path,id){
|