1:在根目录下增加vue.config.js文件,将publicPath设置为‘./‘
module.exports = {
outputDir: ‘regulations‘,
assetsDir: ‘static‘,
publicPath: ‘./‘
}
2:如果路由为history模式,找到路由下的index.js文件。注释掉mod
const router = new VueRouter({
//mode: "history",
base: process.env.BASE_URL,
routes,
});
原文:https://www.cnblogs.com/gumuchenglin/p/14841077.html