【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常

pull/6896/merge
JEECG 2 weeks ago
parent b16fdef8dc
commit 62f7b0d489

@ -185,6 +185,10 @@ export function useCustomSelection(
let bodyResizeObserver: Nullable<ResizeObserver> = null; let bodyResizeObserver: Nullable<ResizeObserver> = null;
// 获取首行行高 // 获取首行行高
watchEffect(() => { 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) { if (bodyEl.value) {
// 监听div高度变化 // 监听div高度变化
bodyResizeObserver = new ResizeObserver((entries) => { bodyResizeObserver = new ResizeObserver((entries) => {
@ -198,13 +202,15 @@ export function useCustomSelection(
bodyResizeObserver.observe(bodyEl.value); bodyResizeObserver.observe(bodyEl.value);
const el = bodyEl.value?.querySelector('tbody.ant-table-tbody tr.ant-table-row') as HTMLDivElement; const el = bodyEl.value?.querySelector('tbody.ant-table-tbody tr.ant-table-row') as HTMLDivElement;
if (el) { if (el) {
// update-begin--author:liaozhiyang---date:20241111---for【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常
nextTick(() => {
rowHeight.value = el.offsetHeight; rowHeight.value = el.offsetHeight;
});
// update-end--author:liaozhiyang---date:20241111---for【issues/7442】basicTable从默认切换到宽松紧凑时多选框显示异常
return; return;
} }
} }
rowHeight.value = 50; rowHeight.value = 50;
// 这种写法是为了监听到 size 的变化
propsRef.value.size && void 0;
}); });
onMountedOrActivated(async () => { onMountedOrActivated(async () => {

Loading…
Cancel
Save