需求
在微信小程序分享页面时,打开页面按理应该是先走完
app.js的onLaunchonShow在执行分享页面的onLoad和onShow;但现因为app.js的onLaunch是异步操作,在等待返回值的时候Page里的onLoad事件就已经执行了。
想要的结果
[App] onLaunch -> [Page] onLoad -> [App] onLaunch sucess callback-> [Page] onLoad
具体实现案例
1、app.js
//app.js
App({
onLaunch () {
wx.request({
url: '接口', //仅为示例,并非真实的接口地址
data: {
},
success(

最低0.47元/天 解锁文章
1935

被折叠的 条评论
为什么被折叠?



