Add documentation for "VNode Lifecycle Events"
atilkan opened this issue ยท 5 comments
Hi,
"VNode Lifecycle Events" are documented in migration docs but there is no information about them in main docs.
Can you add some information about them?
Similar issues;
vuejs/core#9298
vuejs/language-tools#4154
It looks like this has been requested and voiced by other people. Just tagging to get this issue moving: @yyx990803
As mentioned in the PR, we didn't document this feature in both Vue 2 and Vue 3 because it's not a recommended practice to listen to @vue:
events on child components.
Hi @NataliaTepluhina, please tell us why this is not a recommended practice. This approach is beneficial in many situations. Are you guys planning to remove it in breaking changes?
I guess the reason is that it tightly couples child to parent and therefore reducing re-usability.
It is also obsfucating logical flow of the code - because why wouldn't you handle component's lifecycle hook inside the component itself?
I guess the reason is that it tightly couples child to parent and therefore reducing re-usability.
It is also obsfucating logical flow of the code - because why wouldn't you handle component's lifecycle hook inside the component itself?
If someone uses it internally, that answers the question of why.
Why is it a thing anyway?
Also passing functions as prop is considered bad practice. But we have no other choice.