1、文件路径不对
找到config文件夹下的index.js文件修改一下build中的
assetsPublicPath: '/',
改为assetsPublicPath: './',(在/前加.)
2、背景图片路径不对
在css中写的background-img的路径出错 需要找到build文件夹下的utils.js,修改一下
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
在这一段代码中添加:publicPath: '../../',改后如下:
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
3、在route下刷新页面后出现404
把一下的history改为hash,
export default new Router({
mode: 'history',
routes: [
...
],
...
})
改后如下:
export default new Router({
mode: 'hash',
routes: [
...
],
...
})