Przeglądaj źródła

Upload: optimize code (#13973)

Harlan 6 lat temu
rodzic
commit
5ae443a408
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      packages/upload/src/index.vue

+ 2 - 2
packages/upload/src/index.vue

@@ -124,15 +124,15 @@ export default {
   watch: {
     listType(type) {
       if (type === 'picture-card' || type === 'picture') {
-        this.uploadFiles.forEach(file => {
+        this.uploadFiles = this.uploadFiles.map(file => {
           if (!file.url && file.raw) {
             try {
               file.url = URL.createObjectURL(file.raw);
             } catch (err) {
               console.error('[Element Error][Upload]', err);
-              return;
             }
           }
+          return file;
         });
       }
     },