This commit is contained in:
2025-08-15 17:17:07 +08:00
parent b555fd4482
commit 000689d29d

View File

@ -314,6 +314,11 @@ const uploadedSuccessfully = (res: any) => {
emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading();
}
if (props.autoUpload) {
fileUploadRef.value?.clearFiles();
fileList.value = [];
emit('update:modelValue', ''); // 同步到外部 v-model
}
props.onUploadSuccess?.(fileList.value, res);
};
@ -356,7 +361,7 @@ const customUpload = async (options: any) => {
data: formData,
headers: { 'Content-Type': 'multipart/form-data', ...headers.value }
});
handleUploadSuccess(res, options.file);
handleUploadSuccess(res.data, options.file);
} catch (err) {
handleUploadError();
}