<template>
<view class="custom">
<view class="tab-bar bar-container">
<view v-for="(item, index) in list1" :key="index">{{item}}</view>
</view>
</view>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
export default {
name: "customTabBar",
data() {
return {
cStyle: "color: #999999;font-weight: 400;",
selectedStyle: "color: #2B2B2B;font-weight: 500;",
list1: ["ces", "ces1", "ces2"],
};
},
computed: {
...mapState({
selected: state => state.selected,
}),
},
watch: {
},
methods: {
...mapMutations(['setSelected']),
switchTab(path, index) {
const url = path
this.setSelected(index)
uni.reLaunch({
url
})
},
}
}
</script>
2 个回复
2***@qq.com (作者) - 一起开始新世界
<template>
<view class="custom">
<view class="tab-bar bar-container">
<view v-for="(item, index) in list1" :key="index">{{item}}</view>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
export default {
name: "customTabBar",
data() {
return {
cStyle: "color: #999999;font-weight: 400;",
selectedStyle: "color: #2B2B2B;font-weight: 500;",
</script>
2***@qq.com (作者) - 一起开始新世界
已解决