index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="content">
  3. <home v-if="tabbarActive === 'home'" @switch-tab="tabbarActive = 'exhibitor'"/>
  4. <exhibitor v-if="tabbarActive === 'exhibitor'" />
  5. <activity v-if="tabbarActive === 'activity'" />
  6. <user v-if="tabbarActive === 'user'" />
  7. <tab-bar :active.sync="tabbarActive"></tab-bar>
  8. </view>
  9. </template>
  10. <script>
  11. import TabBar from '@/components/layout/tab-bar.vue'
  12. import Home from '@/pages/index/home.vue'
  13. import Exhibitor from '@/pages/exhibitor/index.vue'
  14. import Activity from '@/pages/activity/index.vue'
  15. import User from '@/pages/user/index.vue'
  16. export default {
  17. options: {
  18. styleIsolation: 'shared'
  19. },
  20. components: {
  21. TabBar,
  22. Home,
  23. Exhibitor,
  24. Activity,
  25. User
  26. },
  27. data() {
  28. return {
  29. tabbarActive: 'home'
  30. }
  31. },
  32. created() {
  33. uni.loadFontFace({
  34. family: 'Poppins',
  35. source: 'url("https://oss.starify.cn/test/Poppins-SemiBold.ttf")',
  36. desc: {
  37. fontPath: '', // 本地字体文件的路径
  38. },
  39. success: () => {
  40. console.log('字体加载成功');
  41. },
  42. fail: (e) => {
  43. console.log(e)
  44. console.error('字体加载失败');
  45. },
  46. })
  47. },
  48. methods: {
  49. onClickSearch() {
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. </style>