How to add require('path/to/your/source') in returned data (array)
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-12 09:27:38
0
1
662

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?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
仅有的幸福

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); 
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template