819527061@qq.com
2024-07-30 3e5ccc0369e0b8e61ce50e186246e57c1547ae00
components/tab-bar/tab-bar.vue
@@ -6,9 +6,10 @@
         :placeholder="false"
         :safeAreaInsetBottom="true"
         :border="true">
         <u-tabbar-item v-for="(item, index) in tabBarList"
         <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>
@@ -21,6 +22,7 @@
</template>
<script>
   import store from '@/store';
  import { mapGetters } from 'vuex';
   export default {
      props: {
         current: Number
@@ -34,16 +36,19 @@
         };
      },
      computed: {
         tabBarList() {
        console.log(this.$store.state.userTabbar,'this.$store.state.userTabbar====')
            return this.$store.state.userTabbar;
         }
      ...mapGetters(['userTabbar'])
         // tabBarList() {
      //   console.log(this.$store.state.userTabbar,'this.$store.state.userTabbar====')
         //    return this.$store.state.userTabbar;
         // }
      },
      methods: {
         tabbarchange(e) {
        console.log(this.tabBarList[e].pagePath,'this.tabBarList[e].pagePath===')
        console.log(e,'e-----')
        console.log(this.userTabbar,'this.userTabbar===')
        console.log(this.userTabbar[e].pagePath,'this.userTabbar[e].pagePath===')
            uni.switchTab({
               url: '/' + this.tabBarList[e].pagePath
               url: '/' + this.userTabbar[e].pagePath
            });
         }
      }