| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <template>
- <view>
- <uv-tabbar activeColor="#6FB6B8" :value="currentRouter" @change="change" :placeholder="false">
- <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: {
- type: Array
- },
- currentRouter: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {}
- },
- methods: {
- // 导航栏切换回调
- change(e) {
- this.$emit('changeRouter', this.list[e].show, this.list[e].text, e)
- }
- }
- }
- </script>
- <style scoped>
- .icon {
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|