You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB
Vue

1 year ago
<template>
1 year ago
<view class="tabbar">
1 year ago
<u-tabbar class="tabbar-ios-fix" :border="false" activeColor='#22bf8e' :value="current?current:0" :fixed="true"
:placeholder="true" :safeAreaInsetBottom="true" @change="handleTabClick">
1 year ago
<u-tabbar-item v-for='(item,index) in tabList' :key="index" :text="item.text">
1 year ago
<image style="width: 52rpx;height: 52rpx;margin-top: 65rpx" slot="inactive-icon" class="u-page__item__slot-icon" :src="item.iconPath">
1 year ago
</image>
1 year ago
<image style="width: 52rpx;height: 52rpx;margin-top: 65rpx" slot="active-icon" class="u-page__item__slot-icon" :src="item.selectedIconPath">
1 year ago
</image>
</u-tabbar-item>
</u-tabbar>
</view>
</template>
<script>
import tabBar from "../../util/tabbar";
export default {
props: {
current: Number
},
data() {
return {
tabList: uni.getStorageSync('tabBar')
};
},
mounted() {
1 year ago
1 year ago
},
methods: {
handleTabClick(index) {
uni.switchTab({
url: '/' + this.tabList[index].pagePath,
});
},
}
}
</script>
<style lang="scss">
.u-page__item__slot-icon {
width: 52rpx;
height: 52rpx;
}
1 year ago
1 year ago
/*.tabbar-ios-fix {
1 year ago
bottom: calc(120rpx + env(safe-area-inset-bottom));
1 year ago
}*/
1 year ago
</style>