欢迎访问我的个人网站==》 jiashubing.cn

微信小程序for循环中传递动态参数

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
    })
  }
})

 

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

posted @ 2019-07-17 16:30  贾树丙  阅读(4073)  评论(0编辑  收藏  举报