12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
建站问答 时间:2024-12-01 19:18:12
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
1.使用url带参数传递数据代码实现:toSomeone:function(event){wx.navigateTo({url:'some/some?id='+event.target.id,})}获取传递来的数据onLoad:function(options){
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
1.使用url带参数传递数据
代码实现:
toSomeone:function(event){wx.navigateTo({
url:'some/some?id='+event.target.id,
})
}
获取传递来的数据
onLoad:function(options){console.log(options)
},
2.使用组件模板 template传递参数
<templateis="good"data="{{data}}"></template>
3.使用缓存传递参数
//缓存数据wx.setStorage({
key:'userInfo',
data:res.userInfo
})
getUsersInfo:function(){
//读取缓存登录
wx.getStorage({
key:'userInfo',
success:function(res){
this.userInfo=res.userInfo;
}
})
}
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19