一些常规的报错和解决方法:
1、vue创建项目后,项目启动时报错
You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
解决方法:
2、代码运行后,
eslint
报错
Use // eslint-disable-next-line to ignore the next
line. Use /* eslint-disable */ to ignore all warnings in a file.
ERROR in [eslint]
解决方案:
3、
Uncaught (in promise) NavigationDuplicated{_name: "NavigationDuplicated"}
连续点击路由出现报错
解决方案:
在router文件夹下的index.js中加入以下代码:
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}