OnActivated does not trigger when element is added to the page after timeout
Vue version
3.2.37
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-htwvba
Steps to reproduce
- Wait 3 seconds
- "ACTIVATED" is never printed, even though the element is now visible
What is expected?
The onActivated
-hook should run once
What is actually happening?
The onActivated
-hook never runs
System Info
No response
Any additional comments?
No response
Registers a callback to be called after the component instance is inserted into the DOM as part of a tree cached by
.
https://vuejs.org/api/composition-api-lifecycle.html#onactivated
You might be looking for onMounted