From 62f7b0d4894dab291009e1c223a0b34604474ffc Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Tue, 12 Nov 2024 09:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7442=E3=80=91basicTable?= =?UTF-8?q?=E4=BB=8E=E9=BB=98=E8=AE=A4=E5=88=87=E6=8D=A2=E5=88=B0=E5=AE=BD?= =?UTF-8?q?=E6=9D=BE=E7=B4=A7=E5=87=91=E6=97=B6=E5=A4=9A=E9=80=89=E6=A1=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Table/src/hooks/useCustomSelection.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jeecgboot-vue3/src/components/Table/src/hooks/useCustomSelection.tsx b/jeecgboot-vue3/src/components/Table/src/hooks/useCustomSelection.tsx index e6a996e9..76d0a684 100644 --- a/jeecgboot-vue3/src/components/Table/src/hooks/useCustomSelection.tsx +++ b/jeecgboot-vue3/src/components/Table/src/hooks/useCustomSelection.tsx @@ -185,6 +185,10 @@ export function useCustomSelection( let bodyResizeObserver: Nullable = null; // 获取首行行高 watchEffect(() => { + // update-begin--author:liaozhiyang---date:20241111---for:【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常 + // 这种写法是为了监听到 size 的变化 + propsRef.value.size && void 0; + // update-end--author:liaozhiyang---date:20241111---for:【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常 if (bodyEl.value) { // 监听div高度变化 bodyResizeObserver = new ResizeObserver((entries) => { @@ -198,13 +202,15 @@ export function useCustomSelection( bodyResizeObserver.observe(bodyEl.value); const el = bodyEl.value?.querySelector('tbody.ant-table-tbody tr.ant-table-row') as HTMLDivElement; if (el) { - rowHeight.value = el.offsetHeight; + // update-begin--author:liaozhiyang---date:20241111---for:【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常 + nextTick(() => { + rowHeight.value = el.offsetHeight; + }); + // update-end--author:liaozhiyang---date:20241111---for:【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常 return; } } rowHeight.value = 50; - // 这种写法是为了监听到 size 的变化 - propsRef.value.size && void 0; }); onMountedOrActivated(async () => {