VueJS Advance

By han, 1 September, 2022

Component Lifecycle

The three phases are: mounted, updated, and unmounted.

Each Vue component instance goes through a series of initialization steps when it's created - for example, it needs to set up data observation, compile the template, mount the instance to the DOM, and update the DOM when data changes. Along the way, it also runs functions called lifecycle hooks, giving users the opportunity to add their own code at specific stages.