We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序的生命周期可以分为三部分:应用生命周期、页面生命周期和组件生命周期。下面我会详细介绍每个生命周期的函数及其触发时机。
应用生命周期函数定义在app.js中。
页面生命周期函数在page.js中定义。
组件生命周期函数在component.js中定义。
一个典型的完整生命周期顺序为:
小程序打开:onLaunch -> onShow -> onLoad -> onShow -> onReady
进入新页面:onHide -> onLoad -> onShow -> onReady
返回上一页:onUnload -> onShow
小程序切后台:onHide
小程序重启:onLaunch -> onShow
The text was updated successfully, but these errors were encountered:
No branches or pull requests
面试官:说说微信小程序的生命周期函数有哪些?
微信小程序的生命周期可以分为三部分:应用生命周期、页面生命周期和组件生命周期。下面我会详细介绍每个生命周期的函数及其触发时机。
一、应用生命周期
应用生命周期函数定义在app.js中。
二、页面生命周期
页面生命周期函数在page.js中定义。
三、组件生命周期
组件生命周期函数在component.js中定义。
四、执行顺序
一个典型的完整生命周期顺序为:
小程序打开:onLaunch -> onShow -> onLoad -> onShow -> onReady
进入新页面:onHide -> onLoad -> onShow -> onReady
返回上一页:onUnload -> onShow
小程序切后台:onHide
小程序重启:onLaunch -> onShow
The text was updated successfully, but these errors were encountered: