微信小程序頁面帶參數跳轉及接收參數內容navigator


功能從index頁面跳轉到draw頁面,並在draw頁面獲取id及imgUrl 
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>

在draw.js中:

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM