vuejs项目打包后的提示问题

提示的问题是:

Tip: built files are meant to be served over an HTTP server.

Opening index.html over file:// won't work.

解决办法:

因为vue-cli的默认配置中, publishPath是用绝对目录, 所以dist文件夹里的文件必须放在服务器的根目录, 如果你想本地打开的话, 可以在npm run build完成之后执行以下命令:

cd distnpminstall-ghttp-server hs    // 该命令只需执行一次, 安装过之后, 以后就不需要重复安装了 

你可能感兴趣的:(vuejs项目打包后的提示问题)