修改vue的url
1.修改router的index.js文件,增加base url的配置
2.修改config的index.js文件。
bulid的index,assetsRoots和assetsPublicPath的值
3.在src的同级目录添加WEB-INF和web.xml文件
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"> <display-name>Router for Tomcat</display-name> <error-page> <error-code>404</error-code> <location>/index.html</location> </error-page> </web-app>
4.修改build的webpack.prod.conf.js文件,增加一项CopyWebpackPlugin配置