|
|
@@ -1,19 +1,8 @@
|
|
|
<template>
|
|
|
<view class="tabbar_box">
|
|
|
- <view
|
|
|
- class="tabBarItem"
|
|
|
- v-for="(item, index) in tabList"
|
|
|
- :key="index"
|
|
|
- @click="switchTab(index, item)"
|
|
|
- >
|
|
|
- <image
|
|
|
- :src="currentTabIndex == index ? item.selectedIconPath : item.iconPath"
|
|
|
- class="icon_tab"
|
|
|
- ></image>
|
|
|
- <view
|
|
|
- class="title"
|
|
|
- :style="[currentTabIndex == index ? {'color': tintColor} : {'color': color}]"
|
|
|
- >{{item.text}}</view>
|
|
|
+ <view class="tabBarItem" v-for="(item, index) in tabList" :key="index" @click="switchTab(index, item)">
|
|
|
+ <image :src="current == index ? item.selectedIconPath : item.iconPath" class="icon_tab"></image>
|
|
|
+ <view class="title" :style="[current == index ? {'color': tintColor} : {'color': color}]">{{item.text}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -65,11 +54,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
switchTab (index, item) {
|
|
|
- this.currentTabIndex = index
|
|
|
+ this.currentTabIndex = this.current
|
|
|
uni.switchTab({
|
|
|
url: item.pagePath
|
|
|
})
|
|
|
- this.$emit('click', index)
|
|
|
+ // this.$emit('click', index)
|
|
|
}
|
|
|
},
|
|
|
}
|