浏览代码

附件组件修改

wangwei 3 年之前
父节点
当前提交
a9838ec195
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/components/Form/src/components/upload/UploadFile.vue

+ 5 - 1
src/components/Form/src/components/upload/UploadFile.vue

@@ -103,12 +103,16 @@
           files.map((item) => {
             urls.push(item.url);
           });
-          state.fileUrls += ',' + urls.toString();
+          if (state.fileUrls) {
+            state.fileUrls += ',';
+          }
+          state.fileUrls += urls.toString();
         }
         emit('change', state.fileUrls);
       }
 
       watch(props, (props: PropsType) => {
+        state.fileUrls = props.value;
         state.file_list = props.value.split(',');
       });
       function getFilename(filePath) {