1.根目录新建vue.config.js
2.在里面添加以下配置
module.exports = { publicPath: "./" };
3.最后还需要修改一下router/index.js的内容,把mode:history注释掉
接下来打开页面,就能正常显示了