Component Lifecycle
[vue]
The lifecycle of a Vue component goes like this:
new Vue()is executed, starting the process- Events and Lifecycle initiate
beforeCreate()function executes- Injections and Reactiviti initiate
created()function executes- Template is compiled into a render function
beforeMount()is called- Template mounts to DOM by replacing
elwithvm.$el mounted()function executes- The component is mounted
- when data changes
beforeUpdate()executes - Virtual DOM re-renders and patches
updated()executes
- when data changes
beforeDestroy()executes whenvm.$destroy()is called- Watchers, children and event listeners get torn down
destroyed()executes