Add `target` param to route hooks
Author: tbontb-iaqCreated Sep 2, 2025Updated Sep 2, 2025
The `onActivated` hook accepts a second parameter of type `ComponentInternalInstance`, which makes it possible to use it outside the setup block, such as in custom directives. I noticed that the underlying implementation of the vue router's composition api is actually `onUnmounted`, `onDeactivated`, and `onActivated`, which can all specify the component instance by passing in the second parameter.
Source: vuejs/vue-router