diff --git a/src/components/Modal/src/Modal.tsx b/src/components/Modal/src/Modal.tsx index db1c9cc9a49..379c4a3f7f3 100644 --- a/src/components/Modal/src/Modal.tsx +++ b/src/components/Modal/src/Modal.tsx @@ -80,17 +80,20 @@ export default defineComponent({ }; }; }; + const handleDrag = () => { const dragWraps = document.querySelectorAll('.ant-modal-wrap'); for (const wrap of dragWraps as any) { const display = getStyle(wrap, 'display'); + const draggable = wrap.getAttribute('data-drag'); if (display !== 'none') { // 拖拽位置 - draggable === null && drag(wrap); + (draggable === null || props.destroyOnClose) && drag(wrap); } } }; + watchEffect(() => { if (!props.visible) { return;