优化
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user