微信小程序 页面跳转navigator与传递参数
2017-04-24 14:38
1076 查看
页面之间跳转使用 navigator标签,wx.navigateTo ,wx.redirectTo
1、URL就是跳转的页面路径.上面代码中就是navigator目录下的navigator页面,title是参数。
navigator下redirect属性是值在当前页打开.如果不加redirect就是跳转到新页面.都可以携带参数。
如果需要传多个参数, 用 & 链接即可
或者
2、在跳转的js代码可以获取到title参数
文件引用:
https://mp.weixin.qq.com/debug/wxadoc/dev/component/navigator.html?t=1476197487811
http://www.jianshu.com/p/0135769db89c
1、URL就是跳转的页面路径.上面代码中就是navigator目录下的navigator页面,title是参数。
navigator下redirect属性是值在当前页打开.如果不加redirect就是跳转到新页面.都可以携带参数。
如果需要传多个参数, 用 & 链接即可
<navigator url="../navigator/navigator?title=我是navigate" >跳转到新页面</navigator> <navigator url="../redirect/redirect?title=我是redirect" [code]open-type="redirect">在当前页打开</navigator> [/code]
或者
// 跳转到新页面 wx.navigateTo({ url: "../navigator/navigator?title=我是navigate" }) // 在当前页打开 wx.redirectTo({ url: ../redirect/redirect?title=我是redirect" })
2、在跳转的js代码可以获取到title参数
Page({ data:{ title: "", }, onLoad: function(options) { this.setData({ title: options.title }) } })
文件引用:
https://mp.weixin.qq.com/debug/wxadoc/dev/component/navigator.html?t=1476197487811
http://www.jianshu.com/p/0135769db89c
相关文章推荐
- 微信小程序页面带参数跳转及接收参数内容navigator
- [转] 微信小程序 页面跳转 传递参数
- 微信小程序的页面跳转和参数传递,页面生命周期
- 微信小程序——页面跳转传递参数(实体,对象)
- 微信小程序之页面跳转和参数传递
- 微信小程序页面跳转传递Json对象参数
- 微信小程序之页面跳转和参数传递的实现
- 微信小程序 页面跳转 传递参数
- 微信小程序 navigator 跳转url传递参数
- 微信小程序-navigator 跳转url传递参数
- 微信小程序 页面跳转 传递参数
- 微信小程序-navigator 跳转url传递参数
- 微信小程序详解——页面之间的跳转方式【路由】和参数传递
- [微信小程序]页面跳转对象参数的传递方法
- 微信小程序 页面跳转 传递参数
- 详解微信小程序 页面跳转 传递参数
- 微信小程序页面带参数跳转及接收参数内容navigator
- 微信小程序详解——页面之间的跳转方式【路由】和参数传递
- 微信小程序页面跳转时传参数
- 微信小程序开发之页面跳转并携带参数