微信小程序之------页面之间相互传递数据方法
来源:互联网 发布:南京艺术学院网络课程 编辑:程序博客网 时间:2024/06/05 20:57
微信小程序之——页面之间相互传递数据方法
1.1通过navigateTo,reLaunch在跳转地址后面加后缀
// 点击跳转 indexTargetLogs1: function () { wx.reLaunch({ url: '../logs/logs?logsView=1', }) }, indexTargetLogs2: function (e) { wx.reLaunch({ url: '../logs/logs?logsView=2', }) }, indexTargetLogs3: function () { wx.reLaunch({ url: '../logs/logs?logsView=3', }) },
1.2对应跳转的页面用options接收参数
onLoad: function (options) {this.setData({ logsView: options.logsView }) }
2.1 通过全局变量传递参数。
app.js
globalData: { js_code:null }
page1
wx.login({ success: function (res) { if (res.code) { app.globalData.js_code = res.code } } })
page2
console.log(app.globalData.js_code)
阅读全文
0 0
- 微信小程序之------页面之间相互传递数据方法
- 页面之间dataset数据传递方法
- 页面之间dataset数据传递方法
- Activity之间数据相互传递
- iframe框架之间js方法相互调用及数据传递
- 页面之间传递数据
- 页面之间相互跳转的参数传递
- 页面之间传递数据方法之一(查询字符串)
- 页面之间传递数据2
- WP8 页面之间传递数据
- Activity页面之间数据传递
- Activity页面之间数据传递
- Activity页面之间数据传递
- Activity页面之间数据传递
- Activity页面之间数据传递
- Android_Activity页面之间数据传递
- 页面之间json数据传递
- 页面之间的数据传递
- java POI 学习第一篇 【创建工作簿,sheet页,单元格】
- 替换空格
- VBA 程序加密破解
- iOS 单元测试 ~断言
- 多重队列的实现
- 微信小程序之------页面之间相互传递数据方法
- 使用okhttp遇到的问题,简单记录
- MySQL学习笔记后续(开发技巧)
- 素数的判定二
- dreamweaver_cs6_mobile_and_web_development_with_html5_css3_and_jquery_mobile.pdf 英文原版 免费下载
- (四)JAVA菜鸟养成记--多态
- 记录第一个小项目,基于django的登录注册页面
- xdoj上位计
- 自启动脚本二