![](/img/trans.png)
[英]select multiple images using <input type=“file” />, update the state to store the image URLs, dynamically add <img /> tags to display them in reactjs
[英]Store an image in browser storage using input type 'file' - Reactjs
當用戶從他/她的計算機中選擇圖像時,我正在嘗試將圖像存儲在瀏覽器存儲中。
<div className="add_grp_image_div margin_bottom">
<img src={img_upload} className="add_grp_image"/>
<input type="file" className="filetype"/>
<span className="small_font to_middle">Add group image</span>
</div>
如上面的代碼所示,當有人單擊該div時,我將打開文件上傳窗口。 我想在上面給定的div中顯示所選圖像。 我該怎么做?
我的html部分看起來像這樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.