vue 控制台错误
控制台显示报错:
Uncaught TypeError: WEBPACK_IMPORTED_MODULE_1_vuex.a.store is not a constructor
解决办法:
将new Vuex.store中的“store”大写:new vuex.Store
控制台显示报错:
Uncaught (in promise) NavigationDuplicated:Avoided redundant navigation to current location: “/xxxxxx“.
问题出现原因:路由重复跳转
解决办法:
修改VueRouter原型对象上的push方法,在router文件夹下的index.js中加入如下代码:
const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) }
本文来自博客园,作者:辉太狼`,转载请注明原文链接:https://www.cnblogs.com/HuiTaiLang1216/p/15464289.html