yangan
18 小时以前 a28d0135ee42809b2c5863609da37155d3ecba5b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<template>
    <view class="tab-bar">
        <u-tabbar :value="current ? current : 0" @change="tabbarchange" :fixed="true" :placeholder="false" :safeAreaInsetBottom="true" :border="true">
            <u-tabbar-item v-for="(item, index) in tabBarList" :key="index" :text="item.text">
                <image class="u-page__item__slot-icon" slot="active-icon" :src="item.selectedIconPath"></image>
                <image class="u-page__item__slot-icon" slot="inactive-icon" :src="item.iconPath"></image>
            </u-tabbar-item>
        </u-tabbar>
    </view>
</template>
<script>
import store from '@/store';
export default {
    props: {
        current: Number
    },
    created() {
        uni.hideTabBar();
    },
    data() {
        return {
            // tabBarList: this.$store.state.userTabbar
        };
    },
    computed: {
        tabBarList() {
            return this.$store.state.userTabbar;
        }
    },
    methods: {
        tabbarchange(e) {
            uni.switchTab({
                url: '/' + this.tabBarList[e].pagePath
            });
        }
    }
};
</script>
<style lang="scss" scoped>
::v-deep.tab-bar {
    .u-tabbar {
        &__content {
            background: #ececec !important;
            &__item-wrapper {
                height: vww(50);
            }
        }
    }
}
 
.u-page__item__slot-icon {
    width: vww(20) !important;
    height: vww(20) !important;
}
</style>