为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

有只小跳蛙 2018-07-25 18:15:24
<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>
查看完整描述

1 回答

?
BIG阳

TA贡献1859条经验 获得超6个赞

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>
}
}

查看完整回答
反对 回复 2018-08-20
  • 1 回答
  • 0 关注
  • 1887 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信