mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 08:36:19 +08:00
fix: fix modal dragging failure when destroyOnClose=true (#51)
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user