Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for "VNode Lifecycle Events" #2851

Closed
atilkan opened this issue May 3, 2024 · 5 comments
Closed

Add documentation for "VNode Lifecycle Events" #2851

atilkan opened this issue May 3, 2024 · 5 comments
Labels
content Issues / PRs related to docs content core-team Issues / PRs that require core team attention

Comments

@atilkan
Copy link

atilkan commented May 3, 2024

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?

@atilkan
Copy link
Author

atilkan commented May 7, 2024

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

@bencodezen bencodezen added content Issues / PRs related to docs content core-team Issues / PRs that require core team attention labels May 7, 2024
@NataliaTepluhina
Copy link
Member

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.

@ngocsangyem
Copy link

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?

@AloisSeckar
Copy link
Contributor

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?

@atilkan
Copy link
Author

atilkan commented Jul 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues / PRs related to docs content core-team Issues / PRs that require core team attention
Projects
None yet
Development

No branches or pull requests

5 participants