[bugfix] Uploader: can not upload same file when before-read (#2971)

This commit is contained in:
neverland
2019-03-14 21:14:48 +08:00
committed by GitHub
parent 2e7ca412ff
commit d7760cf4d0
3 changed files with 13 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ export default sfc({
files = files.length === 1 ? files[0] : [].slice.call(files, 0);
if (!files || (this.beforeRead && !this.beforeRead(files))) {
this.resetInput();
return;
}
@@ -82,7 +83,13 @@ export default sfc({
this.$emit('oversize', files);
} else {
this.afterRead && this.afterRead(files);
this.$refs.input && (this.$refs.input.value = '');
}
this.resetInput();
},
resetInput() {
if (this.$refs.input) {
this.$refs.input.value = '';
}
}
},