| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <view>
- <uv-tabbar activeColor="#6FB6B8" :value="currentRouter" @change="change">
- <uv-tabbar-item v-for="(item, index) in list" :key="index" :text="item.text">
- <template v-slot:active-icon>
- <image class="icon" :src="item.imgUrlActive"></image>
- </template>
- <template v-slot:inactive-icon>
- <image class="icon" :src="item.imgUrl"></image>
- </template>
- </uv-tabbar-item>
- </uv-tabbar>
- </view>
- </template>
- <script>
- export default {
- props: ['list'],
- data() {
- return {
- currentRouter: 0
- }
- },
- created() {},
- mounted() {},
- methods: {
- // 导航栏切换回调
- change(e) {
- this.currentRouter = e
- this.$emit('changeRouter', this.list[e].show, this.list[e].text)
- }
- }
- }
- </script>
- <style scoped>
- .icon {
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|