传参页面书写代码:
uni.switchTab({
url: item.link,
success: function(res) {
getApp().globalData.paramsData={
arrow_show: item.id
};
}
})
接收参数页面:
onLoad(options){
let {s,t} = topAdaption();
this.statusBarHeight = s;
this.titleBarHeight = t;
this.arrow_show = getApp().globalData.paramsData.arrow_show
this.getDates()
},
在onLoad函数中通过getApp().globalData.paramsData获取传过来的参数对象使用。
————————————————
版权声明:本文为优快云博主「Self-Healer」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/Anlantic/article/details/132151683