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

时间:2022-10-14 20:05:41
<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>
  • 1
  • 2
  • 3
  • 4

微信小程序页面带参数跳转及接收参数内容navigator 
在draw.js中:

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