123456789101112131415161718192021222324252627282930313233 |
- <template>
- <view class="custom-tabbar">
- <view v-for="(item, index) in tabList" :key="index" @click="switchTab(item)">
- <!-- <image :src="activeIndex === index ? item.selectedIcon : item.icon" /> -->
- <text :style="{ color: activeIndex === index ? selectedColor : defaultColor }">
- {{ item.text }}
- </text>
- </view>
- </view>
- </template>
- <script setup>
- const tabList = [
- {text: '首页',pagePath: '/pages/index/index'}, ,
- {text: '校园动态',pagePath: '/pages/dqgzDangjiangongzuo/dqgzDangjiangongzuo'},
- {text: '招生就业',pagePath: '/pages/index/index'},
- {text: '联系方式',pagePath: '/pages/index/index'}
- ]
- const props = defineProps({
- activeIndex: {
- type: String
- }
- })
-
- function switchTab(item) {
- console.log('item', item)
- uni.reLaunch({ url: item.pagePath });
- }
- </script>
- <style>
- </style>
|