From the returned data, there is the src address of img, <img :src="item.img_url" alt="">
, but the src address path will not be compiled by webpack , and still maintains the relative path status, eventually generating a 404 error.
How to solve it?
仅有的幸福2017-06-12 09:29:38
After you use ajax
to get the array containing these img_url
, it will be processed immediately
Similar to this
function url_parse(arr){
return arr.map(item => {
item.img_url = xxxxxxxxxxxxxxxxxxx;
return item;
});
}
imgArr = url_parse(imgArr);