<view class="gg">
<view v-for="(item,index) in zblist" :key="index" @click="tiaozhuan(`zhibo?id=${index}`)" class="item">
<img :src="item.src" alt="">
<view>{{item.name}}</view>
</view>
</view>
const tiaozhuan = (url) => {
uni.navigateTo({
url
})
}
zhifu页面
<u-tabs :list="data.list" :current="current"></u-tabs>
<script setup>
import {
nextTick,
ref,
reactive
} from 'vue'
import {
onLoad
} from "@dcloudio/uni-app"
const data = reactive({
list: [{
id: 0,
name: '直播展示'
}, {
id: 1,
name: '合作展示'
}, {
id: 2,
name: '公司展示'
}, {
id: 3,
name: '活动展示'
}, {
id: 4,
name: '品牌展示'
}],
})
let current = ref(0)
onLoad((option) => {
nextTick(() => {
current.value = option.id
})
});