Browse Source

上传多个覆盖

15591641157 2 months ago
parent
commit
444aa90052
1 changed files with 5 additions and 6 deletions
  1. 5 6
      packages/merchant/src/components/data-form.vue

+ 5 - 6
packages/merchant/src/components/data-form.vue

@@ -244,12 +244,11 @@ defineExpose({
                   ? []
                   : modelValue[prop]?.split(',').map((it) => ({ url: it })),
             }"
-            @change="
-              ({ fileList }) =>
-                (modelValue[prop] = fileList
-                  .map(({ response }) => JSON.parse(response).data)
-                  .join(','))
-            "
+            @change="({ fileList }) => {
+    const newUrls = fileList.map(({ response }) => JSON.parse(response).data);
+    const existingUrls = modelValue[prop]?.split(',') ?? [];
+    modelValue[prop] = [...existingUrls, ...newUrls].join(',');
+  }"
           ></wd-upload>
           <wd-button
             v-if="type === 'Submit'"