vant icon indicating copy to clipboard operation
vant copied to clipboard

Uploader 组件 after-read 无法取得 上传文件名。

Open highmore opened this issue 8 years ago • 3 comments

代码如下: <van-uploader accept="image/gif, image/jpeg, image/*" :before-read="onStartReadFile" :after-read="onReadFile"> <van-icon name="photograph"></van-icon> </van-uploader> methods: { onReadFile(file) { console.log('File: '+JSON.stringify(file.file)); this.upload_picture = file.content; }, onStartReadFile() { this.$toast.loading({ mask : true, message : '上传中...' }); return true; } }

onReadFile 结果 "file:{}"

highmore avatar May 15 '18 15:05 highmore

安卓调取图库的时候 直接点击图片 还没等点击确定按钮就直接上传了,这个有办法控制吗

r70kg avatar May 16 '18 04:05 r70kg

@highmore File 对象中是包含 name 字段的 @junwei1114 这个可以自己研究下有没有属性能控制

chenjiahan avatar May 18 '18 03:05 chenjiahan

console.log可以打印出file,但是放formdata里面就没有值,debugger状态下file会闪下才出来

Safisun avatar Jun 07 '18 08:06 Safisun