1 渲染

  1. <view class="text-area">
  2. <view class="adname" v-for="item in name" :key="item.ad_name">
  3. <text class="text">{{item.ad_name}}</text>
  4. </view>
  5. </view>

2 跳转传值

  1. <view class="text-area">
  2. <view class="adname" v-for="item in name" :key="item.ad_name">
  3. <text @click="handleJump(item.ad_id)" class="text">{{item.ad_name}}</text>
  4. </view>
  5. </view>

2-1 点击事件传值

  1. # 创建一个新页面,通过点击事件跳转传值
  2. methods: {
  3. handleJump(id){
  4. console.log(id);
  5. uni.navigateTo({
  6. url:`./test/01?id=${id}`
  7. })
  8. }
  9. },

2-2 接收传值

  1. <template>
  2. <view>你好</view>
  3. </template>
  4. <script>
  5. export default {
  6. onLoad:function(option){
  7. console.log(option)
  8. }
  9. }
  10. </script>
  11. <style>
  12. </style>