Responsive state changes before updating the DOM tree
onUpdated
After updating the DOM tree in response to state changes
onBeforeUnmount
Before component uninstallation
onUnmounted
After the component is unmounted
<KeepAlive> life hook
When using <KeepAlive> to cache components, the cached components will not be destroyed and created frequently, causing some of the above components to not be executed, and then there will be two more above hooks.
name
execution time
onActivated
When a component (page) is inserted (displayed) into the DOM
onDeactivated
When the component (page) is removed (not displayed) from the DOM