-
-
Notifications
You must be signed in to change notification settings - Fork 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
Add beforeUpdate to route config #2834
Comments
Thanks for the proposal but regarding hooking into navigation cycle to show loading experience, this won't add anything to hook on. import { checkIdAccess } from '@/guards'
export default {
beforeRouteEnter: checkIdAccess,
beforeRouteUpdate: checkIdAccess,
}
This is untrue and we already talked about it in #2830 ... |
It's impossible to handle displaying loading on fetching of lazy loaded component and guard for route update for now. |
My case is: On route update I need to change seo related things outside component eg: canonical link or meta. And this changes are related only to several routes. If I lazyload component and want display loading during fetching of it I lose feature of I can add I think for such tasks |
Beside lazy loading why we need component to simply guard route update? Now we can guard enter to path without using component to do this job why not update? |
Hello, |
I agree, there are applications where we don't need the component for a refresh case necessarily. I have a case where I wish to fetch the ID number for a given URL slug via an API query and I don't need the component for that. Because of client-side caching in my case, it's very efficient to just keep firing the same API query on each route change - the query cache will return the result instead of querying the server - but the current implementation does not allow this. I'd be with the in-router version of "onUpdate" to not have component access. |
What problem does this feature solve?
Since for now we can't handle lazy loading components without losing access to navigation hooks build in components we should give equal API on router config level.
For now we can only add
beforeEnter
route guard. It would be usefull if we hadbeforeUpdate
guard too.Problem with lazy loading components described here:
#2830
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: