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 }]);
       }