Browse Source

fix(uploader): clearInput props bug

richard1015 4 years ago
parent
commit
029b1a0eec
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/packages/uploader/index.vue

+ 4 - 4
src/packages/uploader/index.vue

@@ -262,10 +262,6 @@ export default create({
       const $el = event.target as HTMLInputElement;
       let { files } = $el;
 
-      if (props.clearInput) {
-        clearInput($el);
-      }
-
       if (props.beforeUpload) {
         props.beforeUpload(files).then((f: Array<File>) => {
           const _files: File[] = filterFiles(new Array<File>().slice.call(f));
@@ -280,6 +276,10 @@ export default create({
         fileList,
         event
       });
+
+      if (props.clearInput) {
+        clearInput($el);
+      }
     };
 
     return {