-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Version
4.0.0-rc.3
Reproduction link
https://codepen.io/no-map/pen/ZEONNxo
Steps to reproduce
i am using router.beforeEach function to add async routers.
as follows
router.beforeEach(async (to, from, next) => {
if(noServiceRoutes) {
await getServiceRoutes()
router.addRoute()
next({ ...to, replace: true })
}
...
})
this is work.
but when i use '/:pathMatch(.)' to redirect all notFound routes to 404
{
path: '/:pathMatch(.*)*',
redirect: '/404'
},
something wrong.
when i refresh my brower. router.beforeEach can not work. allways redirect to 404 pages.
What is expected?
i think router.beforeEach shoud work.
What is actually happening?
router.beforeEach did not work.
please tell me how to make it works. thanks
Metadata
Metadata
Assignees
Labels
No labels