Add beforeUpdate to route config
See original GitHub issueWhat 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 had beforeUpdate
guard too.
Problem with lazy loading components described here: https://github.com/vuejs/vue-router/issues/2830
What does the proposed API look like?
const router = new VueRouter({
routes: [
{
path: '/foo',
component: Foo,
beforeUpdate: (to, from, next) => {
// ...
}
}
]
})
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Navigation Guards | Vue Router
You can add the following options to route components: ... The beforeRouteEnter guard does NOT have access to this , because the guard...
Read more >Update VueJs component on route change - Stack Overflow
I can access the beforeEach hook in the routing configuration. Is there a way I can target my component specifically and change one...
Read more >Form.BeforeUpdate event (Access) - Microsoft Learn
The setting determines if the BeforeUpdate event occurs. Setting the Cancel argument to True (1) cancels the BeforeUpdate event. Remarks.
Read more >Back-end customization - Strapi Developer Docs
All elements of Strapi's back end, like routes, policies, middlewares, controllers, services, models, requests, responses, and webhooks, can be customized.
Read more >Field Service Custom Triggers - Salesforce Developers
Calendar Sync's settings are located in Field Service settings page. From the settings page, ... Before Update: (content is the same as Before...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the proposal but regarding hooking into navigation cycle to show loading experience, this won’t add anything to hook on.
beforeRouteUpdate
is specific to components because we are on the component and have access tothis
. You can already write the guard somewhere and pass it to the component by importing it:This is untrue and we already talked about it in #2830 …
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?