
vue
TomHe789
这个作者很懒,什么都没留下…
展开
-
vue-router嵌套路由切换外层路由时不改变内层路由的定位状态
案例中的路由映射代码const routes = [ { path: '/', redirect: '/home' }, { path: '/home', component: () => import('./../components/Home'), meta: { title: 'home' }, children: [ { path: 'message', compone原创 2021-04-23 16:12:56 · 384 阅读 · 0 评论 -
vue报错Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location...
今天学习vue-router时出现如下报错,百度了一下,好像是vue-router版本不兼容的问题,解决方法为在router/index.js文件中加入一段代码报错提示信息报错代码需要插入的代码段const originalPush = VueRouter.prototype.pushVueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err原创 2021-04-22 17:22:29 · 258 阅读 · 0 评论