vue-router
vue-router copied to clipboard
[Docs] Incomplete Navigation Resolution Flow
What problem does this feature solve?
https://github.com/vuejs/vue-router/blob/dev/docs/en/advanced/navigation-guards.md#the-full-navigation-resolution-flow
I think the docs are lacking full flow, not mentioning 'beforeRouteLeave' for example. Would be cool if diagram were to be created, such as used on Vue lifecycle
https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram
Based on my reading of source code, it appears beforeRouteLeave is the first item in the navigation guard lifecycle. This makes sense to me because the intention, at least in the docs, is to be a hook for preventing users from leaving the page.
https://github.com/vuejs/vue-router/blob/dev/src/history/base.js#L117
After looking at the docs again the leave hooks are referenced in the flow but are not using the keyword beforeRouteLeave
which actually made me miss it too. This PR changes that but I dont think I'm qualified to make the diagram :).
Now that you've said it, it surely does make more sense! Docs are still a little bit more hard to grasp the main ones :D Especially when looked on late at night))
I have attempted to create a lifecycle diagram, but I don't think it is clear enough! Feedback welcome
@posva Hey! Could you give me some feedback on the diagram, I went purely based on the docs - and I do think it can be improved!
Sorry I haven't given you feedback on this yet. I'll likely check it in the following weeks/month
@posva no worries, take your time! 👍
I'm fairly sure beforeRouteEnter doesn't get called if the component is re-used
beforeRouteLeave
also depends on whether the component is re-used.
does exist any update?(i loved this diagram too much)
Hey @posva You can give a feedback here?
@pribilinskiy is called "Open Source Project". When we contribute we do it with extra time that is not billable.
Your comment was unnecesary rude and adds no value to this thread. Consider it next time.
My apologies, better will try to contribute instead of criticizing