vue router使用addRoute动态添加路由后,刷新页面404

pangqianjin / 2023-09-05 / 原文

解决方法

在路由守卫router.beforeEach中,使用addRoute,且next(to.fullPath)产生新的导航,否则仍然会404