- 圖片不見,解決方法
webpack的config/index.js里面的assetsPublicPath: '/' 這里的 ‘/’改成 ‘./’
打開build/utils.js,在里面找到這個代碼加入publicPath:"../../",其中值可能會有不同,若不同,自己配置成相應(yīng)的即可。
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath:"../../"
})
} else {
return ['vue-style-loader'].concat(loaders)
}
- 組件消失,只有app里面的東西在
路由模式將histroy改成hash模式,起初 mode:'history'
const router = new Router({
mode: 'hash',
})
- 路由不能正常跳轉(zhuǎn),更改api里面的baseUrl路徑,改為你服務(wù)器路徑。這里以本地例子
// 服務(wù)器地址
export let instance = Axios.create({
baseURL: 'http://127.0.0.1:7001' //上線改成你服務(wù)器地址
})
然后放進(jìn)你服務(wù)器就好了