vue 解决addRoutes动态添加路由,刷新404或空白页
网上一大堆解决失效问题的,我感觉有点繁琐,所 以的问题都是next的问题,不知道next({ ...to.path, replace: true })这个语法干嘛,问题就出在这句话了,本人后来改成 next(to.path)这样,所有的问题都没有了代码如下:constantRoutes[0].children = routesrouter.addRoutes(constantRoutes)// next({ …to.path, replace: true })next(to.path)...
原创
2020-05-22 15:42:42 ·
2108 阅读 ·
0 评论