react通过绝对路径遍历显示图片?

<div hidden={this.state.selhidden}>
{this.state.filelist.map(function (item) {
return(<div><img src='http://localhost:3000/scanner/src/pictrue/scan.jpg' alt={item} /><br/></div>);
})
}
</div>




有只小跳蛙
浏览 1962回答 1
1回答

BIG阳

render: (text) => {if (text && text.length) {const imgs = text.map((item, index) =><div key={index} style={{ backgroundImage: `url(${item.mediaUrl})` }} className='bg-cover teacher-medias' />)return <div style={{ display: 'flex' }}>{imgs}</div>}}
打开App,查看更多内容
随时随地看视频慕课网APP