<input ref = {fileRef} type="file" multiple onChange = {() => {
const file = fileRef.current.files[0]
const img = imgRef.current
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = function () {
img.src = this.result
hideRef.current.value = this.result
}
}}/>
简单上传图片
最新推荐文章于 2024-10-18 11:12:30 发布