修改publicPath值为'./'
webpack.base.conf.js / webpack.dev.conf.js 中
output: {
// otherSetting
publicPath: './'
},
devServer: {
hot: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
publicPath: './',
proxy: config.dev.proxyTable
},
路由文件中修改mode为hash
const router = new Router({ mode: 'hash', routes: baseRouters })