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