javascript - react get image from object
三叔
三叔 2017-06-28 09:24:57
0
1
560

1. React failed to get the image from the object

2. The relevant code is as follows:
for(var index =0;index<newsInfo.length;index ){
let aa = newsInfo[index];
...... .....
..........
..........
<img src={aa.newsImg} width="120 " height="100"/>
}
3. The object has been traversed, the above method is not available, <img src={require(aa.newaImg)}> cannot be loaded, please take a look , give me some opinions

三叔
三叔

reply all(1)
Peter_Zhu

let imgs=newsInfo.map((aa,i)=> <img src={aa.newsImg} width="120" height="100"/>)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template