From 3e5ccc0369e0b8e61ce50e186246e57c1547ae00 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期二, 30 七月 2024 18:00:59 +0800
Subject: [PATCH] 申请复磅细节

---
 components/tab-bar/tab-bar.vue |  102 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 61 insertions(+), 41 deletions(-)

diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue
index f52bebc..23af71e 100644
--- a/components/tab-bar/tab-bar.vue
+++ b/components/tab-bar/tab-bar.vue
@@ -1,55 +1,75 @@
 <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 :value="current ? current : 0"
+			@change="tabbarchange"
+			:fixed="true"
+			:placeholder="false"
+			:safeAreaInsetBottom="true"
+			:border="true">
+			<u-tabbar-item v-for="(item, index) in userTabbar"
+				:key="index"
+				:text="item.text">
+        <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;
+	import store from '@/store';
+  import { mapGetters } from 'vuex';
+	export default {
+		props: {
+			current: Number
+		},
+		created() {
+			uni.hideTabBar();
+		},
+		data() {
+			return {
+				// tabBarList: this.$store.state.userTabbar
+			};
+		},
+		computed: {
+      ...mapGetters(['userTabbar'])
+			// tabBarList() {
+      //   console.log(this.$store.state.userTabbar,'this.$store.state.userTabbar====')
+			// 	return this.$store.state.userTabbar;
+			// }
+		},
+		methods: {
+			tabbarchange(e) {
+        console.log(e,'e-----')
+        console.log(this.userTabbar,'this.userTabbar===')
+        console.log(this.userTabbar[e].pagePath,'this.userTabbar[e].pagePath===')
+				uni.switchTab({
+					url: '/' + this.userTabbar[e].pagePath
+				});
+			}
 		}
-	},
-	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);
+<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;
-}
+	.u-page__item__slot-icon {
+		width: vww(20) !important;
+		height: vww(20) !important;
+	}
 </style>

--
Gitblit v1.9.1