for循环中的参数,没法传到对应的 js里,所以直接在 wxml页面上跳转

 

发送参数的 wxml页面

<view class="uploader" wx:for="{{bookList}}" wx:for-item = "item">
  <navigator url="../catalog/catalog?id={{item.id}}&title={{item.title}}" open-type="navigate" class="uploader-text">
    <text>{{item.title}}</text>
  </navigator>
</view>

 

接收参数的 js文件

Page({
  data: {title:''},
  onLoad: function (options) {
      this.setData({
        title: options.title
    })
  }
})

 

原创文章,欢迎转载,转载请注明出处!

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2022-01-28
  • 2021-07-15
  • 2021-05-21
  • 2021-11-21
  • 2022-02-07
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案