The vue component undergoes these 4 phases of life cycle hooks.The lifecyle means the navigation path of the component during its execution.
We will look into the life cycle hooks one by one.
The first phase is the creation phase.So in this phase the component is about to be created.This phase is drill down into two methods
The second phase is the mounting phase.It is this phase the component template or HTML is actually MOUNTED on to the DOM , which you see on the browser. In this phase we have 2 more methods.
The third phase is the updating phase.This phase is fired when data or computed propteries used by the component changes or the component rerenders.There are 2 methods in this phase also.
The fourth phase is the Unmounting phase.It is related to the phase has been removed from the DOM.There are 2 methods in this phase.
The other hooks are Activated,Deactivated,ErrorCaptured,RenderTracked,RenderTriggered.
This is called when kept alive component is activated.
Note:This hook is not called during server side rendering.
This is called when kept alive component is Deactivated.
Note:This hook is not called during server side rendering.
This is called when error from any descendent component is captured.
This errorcaptured hook receives 3 parameters(err,vm,info).
err - Error trace
vm - Component in which error occured
info - vue specific error information such as lifecycle hooks,events etc.
The hook can return false to stop the error.
The last two hooks such as RenderTracked and RenderTriggered are useful for debugging purposes.
This is called when DOM is rerender.This event tells you what operation tracked the component.
This is called when DOM rerender is triggered.This event tells you what operation triggered the rerendering of the component.
Happy Vue Coding !!!