feat:【antd】cropper-modal 删除多余的 Image 预加载逻辑
This commit is contained in:
@@ -43,15 +43,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
// 打开时,进行 loading 加载。后续 CropperImage 组件加载完毕,会自动关闭 loading(通过 handleReady)
|
// 打开时,进行 loading 加载。后续 CropperImage 组件加载完毕,会自动关闭 loading(通过 handleReady)
|
||||||
modalLoading(true);
|
modalLoading(true);
|
||||||
// TODO @puhui999:这里比 ele 多了,是符合预期的哇?
|
|
||||||
const img = new Image();
|
|
||||||
img.src = src.value;
|
|
||||||
img.addEventListener('load', () => {
|
|
||||||
modalLoading(false);
|
|
||||||
});
|
|
||||||
img.addEventListener('error', () => {
|
|
||||||
modalLoading(false);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// 关闭时,清空右侧预览
|
// 关闭时,清空右侧预览
|
||||||
previewSource.value = '';
|
previewSource.value = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user