vue component lifecycle
- Creation:
beforeCreate
: Occurs before the instance is created, data observation, and event/watcher setup.created
: Called synchronously after the instance is created. The data has been observed and the events/watchers have been set up.Mounting:
beforeMount
: Called before the mounting begins: the render function is about to be called for the first time.mounted
: Called after the instance has been mounted, where the component is rendered to the DOM.Updating:
beforeUpdate
: Called when data changes, before the DOM is patched.updated
: Called after a data change causes the DOM to be re-rendered.Destroying:
beforeDestroy
: Called before a Vue instance is destroyed. This is where you can perform cleanup.destroyed
: Called after a Vue instance has been destroyed. Cleanup is done, and the instance is no longer functional.