Closed

Description
There are occasions where a route should be handled everytime it’s considered. For example, I’ve seen it suggested that VueRouter could be used to show a loading indicator by doing the following:
router.beforeEach((to, from, next) => {
LoadIndicator.show();
next();
});
router.afterEach((to, from) => {
LoadIndicator.hide();
});
A route can be cancelled in a component’s beforeRouteEnter
method with next(false)
, but AfterEach
won’t fire since the route never actually loaded and the loading indicatior is stuck.
Something like that would be great:
router.cancel((to, from) => {
LoadIndicator.hide();
});
Metadata
Metadata
Assignees
Labels
No labels