From ae5d45763f39ea71d3dde94c7776e4cd104fcc9e Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Sun, 6 Apr 2025 17:41:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20getVxePopupContainer=E4=B8=8E?= =?UTF-8?q?=E6=96=B0=E7=89=88Vxe=E4=B8=8D=E5=85=BC=E5=AE=B9=20=E5=85=88?= =?UTF-8?q?=E8=BF=94=E5=9B=9Ebody(=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E4=B8=8D=E8=B7=9F=E9=9A=8F)=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=86=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + packages/utils/src/helpers/get-popup-container.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a05034ed..4eb3fe1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - vditor(Markdown)升级3.10.9 - 老版本的文件/图片上传将于下个版本移除 - useDescription将于下个版本移除 +- getVxePopupContainer与新版Vxe不兼容 先返回body(会导致滚动不跟随)后续版本再优化 # 1.2.3 diff --git a/packages/utils/src/helpers/get-popup-container.ts b/packages/utils/src/helpers/get-popup-container.ts index 278a4ced..ac9e5b3b 100644 --- a/packages/utils/src/helpers/get-popup-container.ts +++ b/packages/utils/src/helpers/get-popup-container.ts @@ -21,9 +21,11 @@ export function getVxePopupContainer(_node?: HTMLElement): HTMLElement { * 如果是固定列的情况直接返回body 但是这样不会跟随滚动(个人认为这属于极限场景) * 如果有更好的办法解决 请告知 */ - if (_node?.closest('td.fixed--width')) { - return document.body; - } - // 返回parent元素 + // if (_node?.closest('td.fixed--width')) { + // return document.body; + // } + /** + * 兼容以前代码 先返回body 这样会造成无法跟随滚动 + */ return _node?.parentElement ?? document.body; }