index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <home v-show="showPage != 'my'" />
  3. <my v-show="showPage != 'home'" />
  4. <up-tabbar :fixed="true" :value="showPage" @change="change1">
  5. <up-tabbar-item text="首页" name="home">
  6. <template #active-icon>
  7. <view class="iconfont icon-zhuye-weixuanzhong" style="color: #1965E7;" />
  8. </template>
  9. <template #inactive-icon>
  10. <view class="iconfont icon-zhuye-weixuanzhong" />
  11. </template>
  12. </up-tabbar-item>
  13. <up-tabbar-item text="我的" name="my">
  14. <template #active-icon>
  15. <view class="iconfont icon-wode-weixuanzhong" style="color: #1965E7;" />
  16. </template>
  17. <template #inactive-icon>
  18. <view class="iconfont icon-wode-weixuanzhong" />
  19. </template>
  20. </up-tabbar-item>
  21. </up-tabbar>
  22. </template>
  23. <script setup>
  24. import home from './home.vue';
  25. import my from './my.vue';
  26. import { ref, getCurrentInstance } from 'vue'
  27. const { $Http } = getCurrentInstance().proxy;
  28. const showPage = ref('home');
  29. function change1(value) {
  30. if (value == 'home') $Http.uploadNumber && $Http.uploadNumber();
  31. showPage.value = value;
  32. }
  33. </script>
  34. <style></style>