微信小程序界面跳转传参

前端之家收集整理的这篇文章主要介绍了微信小程序界面跳转传参前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、界面跳转传递参数

跳转新的页面&&what=laiba" hover-class="navigator-hover">跳转到新页面
  当前页面跳转&&what=重定向" open-type="redirect" hover-class="other-navigator-hover">在当前页打开
  

获取参数
Page({
data:{

  },onLoad:function(options){
    // 生命周期<a href="/tag/hanshu/" target="_blank" class="keywords">函数</a>--监听<a href="/tag/yemian/" target="_blank" class="keywords">页面</a>加载
     this.setData({
          title: options.title,what : options.what
    })
  }

})

2、使用事件传递参数

 wx.navigateTo({
  url: '../navigator/redirect?title="zxc"'
})

}

猜你在找的微信小程序相关文章