| | |
| | | <template> |
| | | <view> |
| | | <u-tabbar class="custom-tabbar" zIndex="100" :value="currentTab" :fixed="true" :active-color="activeColor" |
| | | <u-tabbar class="custom-tabbar" zIndex="100" :value="current" :fixed="true" :active-color="activeColor" |
| | | :inactive-color="inactiveColor" @change='change'> |
| | | <u-tabbar-item v-for="(item,index) in curTabList" :icon="item.icon" :key="index" :text="item.name"> |
| | | </u-tabbar-item> |
| | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | currentTab: {}, |
| | | current: Number, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | |
| | | curTabList: [{ |
| | | name: '首页', |
| | | iconPathSelected: '', |
| | | iconPath: '', |
| | | icon: "home", |
| | | iconPathSelected: '/static/img/tabbar-01-selected.png', |
| | | iconPath: '/static/img/tabbar-01.png', |
| | | // icon: "home", |
| | | url: '/pages/home/index' |
| | | }, |
| | | |
| | | { |
| | | name: '圈子', |
| | | iconPathSelected: 'static/img/tabbar-02-selected.png', |
| | | iconPath: 'static/img/tabbar-02.png', |
| | | // icon: "home", |
| | | url: '/pages/home/index' |
| | | }, |
| | | { |
| | | name: '驾驶舱', |
| | | iconPathSelected: 'static/img/tabbar-02-selected.png', |
| | | iconPath: 'static/img/tabbar-02.png', |
| | | // icon: "home", |
| | | url: '/pages/statistics/index' |
| | | }, |
| | | |
| | | |
| | | { |
| | | name: '个人中心', |
| | | iconPathSelected: '', |
| | | iconPath: '', |
| | | icon: "account-fill", |
| | | iconPathSelected: '/static/img/tabbar-03-selected.png', |
| | | iconPath: '/static/img/tabbar-03.png', |
| | | // icon: "account-fill", |
| | | url: '/pages/user/center' |
| | | } |
| | | ] |
| | |
| | | }, |
| | | methods: { |
| | | change(e) { |
| | | this.$emit("change", this.curTabList[e].url) |
| | | uni.switchTab({ |
| | | url: '/' + this.curTabList[e].path |
| | | }) |
| | | // this.$emit("change", this.curTabList[e].url) |
| | | }, |
| | | |
| | | } |