从一个小程序用navigator跳转到另一个小程序走不走app.js里面的方法?

小程序 文章 2021-03-03 17:21 464 0 全屏看文

AI助手支持GPT4.0

从一个小程序用navigator跳转到另一个小程序走不走app.js里面的方法?Can I use the navigator to jump from one small program to another small program using the method in app.js?

从一个小程序用navigator跳转到另一个小程序走不走app.js里面的方法?

小程序转发之后,用户点击转发后的小程序,会走app.js里面的onLaunch方法吗,还有onShow方法?如果小程序本身有打开过,再打开是什么情况呢?


After the small program is forwarded, the user clicks the small program after the forwarding, and will go app.js Is there an onlaunch method or an Onshow method? If the applet itself has been opened, what will happen if it is opened again?

回答:

Samuel.Schrödinger:

当然走app.js方法,本身打开过 在走小程序生命周期内走onShow,打开时间过长或者内存不足小程序自动终止运行走onLaunch +onShow

onLaunch 生命周期回调——监听小程序初始化。

onShow 生命周期回调——监听小程序启动或切前台。

拾忆:

主要应该还是看是属于热启动还是冷启动,冷启动才会执行onLaunch

微喵网络:

onLaunch是小程序启动

onSHow打开就有

-EOF-

AI助手支持GPT4.0