vue的dist放到tomcat没法访问html
$ npm run build ... Tip: built files are meant to be served over an HTTP server. Opening index.html over file:// won't work.
vue的dist放到tomcat没法访问. 修改config/index.jsvue
//assetsPublicPath: '/', assetsPublicPath: './',// 增长一个点,不然npm run build后没法查看
注意,改了assetsPublicPath后,npm run dev后不能访问:chrome
Cannot GET /
参考: http://www.javashuo.com/article/p-hnpkmsbv-cc.htmlnpm
仍是不行. 打开chrome的控制台.tomcat
Failed to load resource: the server responded with a status of 404 () http://130.51.23.12:8280/static/js/app.376299e7505d4fa250ba.js
漏了dist. 不要dist目录,直接放到ROOT,成功了。 参考: http://www.javashuo.com/article/p-bpcdberj-ez.htmlapp