微信小程序navigator带参数跳转及接收参数内容

// index.wxml

<navigator class='looks-view' wx:for="{{imgUrlNew}}" wx:key="index" url="/pages/draw/draw?id={{item.id}}&imgUrl={{item.img}}">
     <image src='{{item.img}}' class='looks-view-image'></image>
     <text class='looks-view-text'>{{item.name}}</text>
</navigator>

// index.js
data: {
    id:'',
    imgUrl:''
},
onLoad: function (options) {
    this.setData({
      id: options.id,
      imgUrl: options.imgUrl
    })
},

 

posted @ 2020-06-05 14:10  糖糖Y  阅读(1479)  评论(0编辑  收藏  举报