MtaTabBar.vue 969 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <view class="custom-tabbar">
  3. <view v-for="(item, index) in tabList" :key="index" @click="switchTab(item)">
  4. <!-- <image :src="activeIndex === index ? item.selectedIcon : item.icon" /> -->
  5. <text :style="{ color: activeIndex === index ? selectedColor : defaultColor }">
  6. {{ item.text }}
  7. </text>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. const tabList = [
  13. {text: '首页',pagePath: '/pages/index/index', icon: '', selectedIcon: ''},
  14. {text: '校园动态',pagePath: '/pages/dqgzDangjiangongzuo/dqgzDangjiangongzuo', icon: '', selectedIcon: ''},
  15. {text: '招生就业',pagePath: '/pages/index/index', icon: '', selectedIcon: ''},
  16. {text: '联系方式',pagePath: '/pages/index/index', icon: '', selectedIcon: ''}
  17. ]
  18. const props = defineProps({
  19. activeIndex: {
  20. type: String
  21. }
  22. })
  23. function switchTab(item) {
  24. console.log('item', item)
  25. uni.reLaunch({ url: item.pagePath });
  26. }
  27. </script>
  28. <style>
  29. </style>