微信小程序页面跳转时传参数
来源:互联网 发布:s7200plc通讯端口设置 编辑:程序博客网 时间:2024/06/05 23:50
1、pagejump.wxml:
<view class="page">
<button type="default" bindtap="onBtnClick">跳转到新页面</button></view>
2、pagejump.js
Page({
data: {
lastval: {},
showBtn: false,
},
onLoad: function (options) {
// 生命周期函数--监听页面加载
var that = this;
console.log('onLoad is invoked');
console.log(options);
that.setData({
lastval: options.val,
})
},
onBtnClick: function () {
var that = this;
console.log('onBtnClick');
wx.navigateTo({
url: '../home/home?tp=2&index=hello bright&showBtn=false',
success: function (res) {
// success
console.log('onBtnClick success() res:');
},
fail: function () {
// fail
console.log('onBtnClick fail() !!!');
},
complete: function () {
console.log('onBtnClick complete() !!!');
// complete
}
})
}
})
3、home.wxml:
<view class="test">新页面新页面tp=={{tp}}</view>
<view class="test">新页面新页面showBtn=={{showBtn}}</view>
<view class="test">新页面新页面index=={{index}}</view>
4、home.js:
Page({
data: {
tp:'',
showBtn: '',
index:'',
},
onLoad: function (options) {
// 生命周期函数--监听页面加载
var that = this;
console.log('onLoad is invoked');
that.setData({
tp: options.tp,
index: options.index,
showBtn: (options.showBtn == "true" ? true : false),
});
console.log("tp="+tp);
}
})
- 微信小程序页面跳转时传参数
- 微信小程序 页面跳转 传递参数
- 微信小程序 页面跳转 传递参数
- 微信小程序 页面跳转与参数传递
- 微信小程序 页面跳转 传递参数
- 微信小程序的页面跳转和参数传递,页面生命周期
- 微信小程序开发之页面跳转并携带参数
- 微信小程序页面跳转传递Json对象参数
- [微信小程序]页面跳转对象参数的传递方法
- 微信小程序-页面跳转
- 微信小程序:页面跳转
- 微信小程序页面跳转
- 微信小程序,页面跳转
- 微信小程序页面跳转
- 小程序跳转页面传递参数2
- 微信小程序页面跳转并传参
- 微信小程序页面跳转传值
- 微信小程序跳转页面传值
- 连接Mysql
- oracle-case
- FlV(H264+AAC)格式详细分析
- irq n: nobody cared (try booting with the "irqpoll" option)
- 为什么我还在用Windows?
- 微信小程序页面跳转时传参数
- Appium+Genymotion+robotframework+python系列一:appium环境配置
- 文章标题
- 【剑指Offer】面试题17:合并两个排序的链表
- 火车购座
- spark--transform算子--coalesce
- 正则表达式替换指定位置的字符串
- CSS要点记录
- Java 普通队列 和 优先级队列 的使用