Activation/Deactivation Related Hooks

Learn and practice the two Vue lifecycle hooks related to component activation/deactivation—activated and deactivated.

Not only can a component be mounted or unmounted, when wrapped in <keep-alive>, it also offers the activated and deactivated hooks. This lesson will only study the hooks, not the <keep-alive> component itself.

Adding the hooks

We can add these hooks in the same way as any other hook.

Get hands-on with 1400+ tech skills courses.