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