00——VUE错误解决记录
2019-06-12 本文已影响0人
biyu6
1.打印错误: error: Unexpected console statement (no-console) at
解决时间:20190612
网上很多解决办法不靠谱,还麻烦,最简单的解决方法是:
在package.json 文件中,搜索 "eslintConfig",在其下的"rules"中添加以下配置:
"rules": {
"no-console":"off"
},
![](https://img.haomeiwen.com/i4988812/5341f8dd068b01d7.png)
2.Vue编译文件上传服务器刷新页面404:
![](https://img.haomeiwen.com/i4988812/e025a8e611eac01e.png)
第一种解决方法:router中不使用'history'模式
第二种解决方法:在服务器上存放Vue编译结果文件的目录下新增一个 WEB-INF 文件夹,文件夹中新增 web.xml 文件,文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1"
metadata-complete="true">
<error-page>
<error-code>404</error-code>
<location>/</location>
</error-page>
</web-app>
![](https://img.haomeiwen.com/i4988812/f096a9326b60e7af.png)