uni-Identify-quality/components/uiq-tabbar/uiq-tabbar.vue

49 lines
1.2 KiB
Vue
Raw Normal View History

2023-09-19 02:50:09 +00:00
<template>
2023-09-19 03:20:41 +00:00
<view class="tabbar">
2023-09-26 12:00:52 +00:00
<u-tabbar class="tabbar-ios-fix" :border="false" activeColor='#22bf8e' :value="current?current:0" :fixed="true"
:placeholder="true" :safeAreaInsetBottom="true" @change="handleTabClick">
2023-09-19 02:50:09 +00:00
<u-tabbar-item v-for='(item,index) in tabList' :key="index" :text="item.text">
2023-09-27 02:04:50 +00:00
<image style="width: 52rpx;height: 52rpx;margin-top: 65rpx" slot="inactive-icon" class="u-page__item__slot-icon" :src="item.iconPath">
2023-09-19 02:50:09 +00:00
</image>
2023-09-27 02:04:50 +00:00
<image style="width: 52rpx;height: 52rpx;margin-top: 65rpx" slot="active-icon" class="u-page__item__slot-icon" :src="item.selectedIconPath">
2023-09-19 02:50:09 +00:00
</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() {
2023-09-19 03:20:41 +00:00
2023-09-19 02:50:09 +00:00
},
methods: {
handleTabClick(index) {
uni.switchTab({
url: '/' + this.tabList[index].pagePath,
});
},
}
}
</script>
<style lang="scss">
.u-page__item__slot-icon {
width: 52rpx;
height: 52rpx;
}
2023-09-19 03:48:23 +00:00
2023-09-26 12:00:52 +00:00
/*.tabbar-ios-fix {
2023-09-19 02:50:09 +00:00
bottom: calc(120rpx + env(safe-area-inset-bottom));
2023-09-26 12:00:52 +00:00
}*/
2023-09-19 02:50:09 +00:00
</style>