提交 9c02d8ec 作者: vben

fix: fix modal dragging failure when destroyOnClose=true (#51)

上级 1c075a7a
...@@ -80,17 +80,20 @@ export default defineComponent({ ...@@ -80,17 +80,20 @@ export default defineComponent({
}; };
}; };
}; };
const handleDrag = () => { const handleDrag = () => {
const dragWraps = document.querySelectorAll('.ant-modal-wrap'); const dragWraps = document.querySelectorAll('.ant-modal-wrap');
for (const wrap of dragWraps as any) { for (const wrap of dragWraps as any) {
const display = getStyle(wrap, 'display'); const display = getStyle(wrap, 'display');
const draggable = wrap.getAttribute('data-drag'); const draggable = wrap.getAttribute('data-drag');
if (display !== 'none') { if (display !== 'none') {
// 拖拽位置 // 拖拽位置
draggable === null && drag(wrap); (draggable === null || props.destroyOnClose) && drag(wrap);
} }
} }
}; };
watchEffect(() => { watchEffect(() => {
if (!props.visible) { if (!props.visible) {
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论