Lifecycle Phases Overview
Creation, mounting, updating, unmounting — what happens in each phase.
A Component Has a Life
Every Vue component goes through a predictable journey: it is created, mounted into the page, updated as data changes, and finally removed. These are the lifecycle phases, and Vue lets you hook into each one.
The Four Phases
- Creation — setup runs, reactivity is initialized.
- Mounting — the DOM is created and inserted.
- Updating — reactive changes trigger re-renders.
- Unmounting — the component is removed and cleaned up.
All lessons in this course
- Lifecycle Phases Overview
- onMounted and onBeforeMount
- onUpdated and onBeforeUpdate
- onUnmounted and Cleanup Patterns