From 26399c63c7f43ff0123c892e443b010350cb8bc8 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Fri, 8 Sep 2023 20:18:27 +0800 Subject: [PATCH] =?UTF-8?q?chore(table):=20=E5=8F=91=E5=B8=834.1.3-alpha.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/table/package.json | 2 +- packages/ui/table/src/hooks/use-col-width.ts | 21 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/ui/table/package.json b/packages/ui/table/package.json index 395551a1b..ca1f40198 100644 --- a/packages/ui/table/package.json +++ b/packages/ui/table/package.json @@ -1,6 +1,6 @@ { "name": "@hi-ui/table", - "version": "4.1.3-alpha.0", + "version": "4.1.3-alpha.1", "description": "A sub-package for @hi-ui/hiui.", "keywords": [], "author": "HiUI ", diff --git a/packages/ui/table/src/hooks/use-col-width.ts b/packages/ui/table/src/hooks/use-col-width.ts index e6ee46307..9a6b5e77a 100644 --- a/packages/ui/table/src/hooks/use-col-width.ts +++ b/packages/ui/table/src/hooks/use-col-width.ts @@ -70,17 +70,18 @@ export const useColWidth = ({ const resizeObserver = new ResizeObserver(() => { if (virtual) { setColWidths(getVirtualWidths()) - } else { - if (measureRowElement.childNodes) { - const _realColumnsWidth = Array.from(measureRowElement.childNodes).map((node) => { - return (node as HTMLElement).getBoundingClientRect().width || 0 - }) - - if (_realColumnsWidth.some((width) => width && width > 0)) { - setColWidths(_realColumnsWidth) - } - } } + // else { + // if (measureRowElement.childNodes) { + // const _realColumnsWidth = Array.from(measureRowElement.childNodes).map((node) => { + // return (node as HTMLElement).getBoundingClientRect().width || 0 + // }) + + // if (_realColumnsWidth.some((width) => width && width > 0)) { + // setColWidths(_realColumnsWidth) + // } + // } + // } }) resizeObserver.observe(measureRowElement)