Lifecycle Hooks
Learn about the Vue instance lifecycle hooks.
Lifecycle hooks
When a Vue instance passes through its lifecycle, it offers some functions that are executed at every transitional step in the lifecycle so that certain tasks can be performed during these stages. These functions are called “lifecycle hooks”.
There are a total of eight lifecycle hooks. There are two hooks for each lifecycle stage as shown below:
- Creation hooks
beforeCreatecreated
- Mounting hooks
beforeMountmounted
- Updating hooks
beforeUpdateupdated
- Destruction hooks
beforeDestroydestroyed
We will talk about each hook separately.
Creation hooks
beforeCreate
The beforeCreate hook runs at the initialization of your component. data has not been ...
Ask