lrf402788946 5 роки тому
батько
коміт
19750cf8f9
1 змінених файлів з 5 додано та 3 видалено
  1. 5 3
      src/components/upload.vue

+ 5 - 3
src/components/upload.vue

@@ -103,9 +103,11 @@ export default {
         this.$set(this, `fileList`, newArr);
       } else if (_.isObject(val)) {
         let object = {};
-        object.name = val.name;
-        object.url = val.url;
-        this.$set(this, `fileList`, [object]);
+        if (_.get(val, `url`)) {
+          object.name = val.name;
+          object.url = val.url;
+          this.$set(this, `fileList`, [object]);
+        }
       } else if (typeof val === 'string') {
         this.$set(this, `fileList`, [{ name: '附件', url: val }]);
       }