修改index.js下的assetsPublicPath 路径为“./” 查看router是否配置为如下方式,把history注释掉 const router = new VueRouter({ mode: ‘history’, /hash模式改为history/这个地方要注释掉,不然打包后不能打开首页 routes // (缩写)相当于 routes: routes })
发布流程 npm run build 会生成dist目录,把dist目录和index.html文件放到需要布置得服务器上