1 渲染
<view class="text-area">
<view class="adname" v-for="item in name" :key="item.ad_name">
<text class="text">{{item.ad_name}}</text>
</view>
</view>
2 跳转传值
<view class="text-area">
<view class="adname" v-for="item in name" :key="item.ad_name">
<text @click="handleJump(item.ad_id)" class="text">{{item.ad_name}}</text>
</view>
</view>
2-1 点击事件传值
# 创建一个新页面,通过点击事件跳转传值
methods: {
handleJump(id){
console.log(id);
uni.navigateTo({
url:`./test/01?id=${id}`
})
}
},
2-2 接收传值
<template>
<view>你好</view>
</template>
<script>
export default {
onLoad:function(option){
console.log(option)
}
}
</script>
<style>
</style>