-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Lifecycle diagram unmounted
=> onUnmounted
#2682
Comments
Why? I think it's consistent with the naming of other things that are mentioned there like mounted, beforeMount, updated, beforeUpdate... |
onUnmounted is the hook, unmounted is the event, you are correct. When I was not very familiar with Lifecycle Hooks, I would look at this flow chart, because mounted is a hook in vue2, so I would think that unmounted is also a hook, and then I would
|
Ah, actually if you're using options API, it's still export default {
unmounted() {
// ...
}
} If you read that page completely, then the section above that image shows the usage (depending on your choice of options/compositions API). event might be wrong technical term in my earlier comment. I believe it's more like onUnmounted is for composition API, unmounted is for options API. And the diagram explicitly mentions options API. |
So the text described by the red border in the lifecycle-diagram is a hook, but it is a hook for the options API. Since the composition API is officially recommended, can we have a lifecycle-diagram corresponding to the options API and composition API? The API Preference in the current document defaults to the composition API, and lifecycle-diagram displays the options API hooks. When we switch the API Preference, it may be better to display the lifecycle-diagram corresponding to the hooks. |
@orionna319 This is a great suggestion! I'll take a look at how we can implement this. |
@orionna319 Sorry for the delay on this. Currently working on the best way to explain this, but what do you think of this draft diagram? |
Amazing work. Thank you very much for your contribution, which allows us to better understand |
lifecycle-diagram
Thanks to the community for their contribution. When I used the documentation, I found that the flow chart was inconsistent with the actual situation.
unmounted => onUnmounted
The text was updated successfully, but these errors were encountered: