Talking about the life cycle of VUE uni app
- 2021-11-29 22:55:44
- OfStack
1. Application life cycle
onLaunch
Triggered when initialization of uni-app is completed (global trigger only once) onShow
When uni-app is started, or onHide is displayed from background to foreground
When uni-app enters the background from the foreground
2. Page Lifecycle
onLoad
Listening page loads onReady
The listening page is rendered for the first time. Note that if the rendering speed is fast, onShow will be triggered before the page enters the animation completion
Listen to the page display. Triggered every time the page appears on the screen, including returning from the lower page point to expose the current page onHide
Listening page hides onUnload
Monitor page uninstall
3. Component lifecycle
beforeCreate
created is called after instance initialization
mounted is called immediately after the instance is created
Called after mounting on the instance. See note for details: It is not certain that all subcomponents are mounted here. If you need to perform operations after the subcomponents are fully mounted, you can use $nextTickdestroyed
Called after the Vue instance is destroyed. When invoked, everything indicated by the Vue instance is unbound, all event listeners are removed, and all child instances are destroyed.
Summarize
This article is here, I hope to give you help, but also hope that you can pay more attention to this site more content!