Open Aadhisivam opened 2 years ago
Edit : Cant Abort onChange event also
Adding a setTimeout worked for me
const onRoute = async ev => {
switch (ev.path) {
case '/login': {
if (auth == true) setTimeout(() => route('/home', true), 0)
}
}
}
the route
cannot be used as the active router is registered in ROUTERS
when it mounted (that means at the time you call route, the ROUTES
is empty list); so instead you can use ev.router.routeTo(...)
.
I would like to abort route transition based on certain conditions , so i utilised onChange event , but it triggers only after URL change. I can abort transition in that event, but the url hash is changed which is irrelevant of the current route.
Is there any way to block this behaviour ?