From 2147c0ee2795d3e2a379db916b9fb74256844e8d Mon Sep 17 00:00:00 2001 From: RickCole Date: Wed, 8 Jun 2022 17:31:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E5=92=8C=E5=9B=BA=E5=AE=9A=E5=88=97=E7=BB=84?= =?UTF-8?q?=E5=90=88=E4=BD=BF=E7=94=A8=E6=97=B6=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4561)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Table/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderers/Table/index.tsx b/src/renderers/Table/index.tsx index 5ce20ca608b..661f73cdb3c 100644 --- a/src/renderers/Table/index.tsx +++ b/src/renderers/Table/index.tsx @@ -1081,11 +1081,11 @@ export default class Table extends React.Component { } = (this.heights = {}); heights.header = table - .querySelector('thead>tr:last-child')! - .getBoundingClientRect().height; - heights.header2 = table - .querySelector('thead>tr:first-child')! + .querySelector('thead')! .getBoundingClientRect().height; + // heights.header2 = table + // .querySelector('thead>tr:first-child')! + // .getBoundingClientRect().height; forEach( table.querySelectorAll('thead>tr:last-child>th'), @@ -1132,7 +1132,7 @@ export default class Table extends React.Component { table.querySelectorAll('thead>tr:first-child>th'), (item: HTMLElement) => { const width = widths2[item.getAttribute('data-index') as string]; - item.style.cssText += `width: ${width}px; height: ${heights.header2}px`; + item.style.cssText += `width: ${width}px; height: ${heights.header}px`; totalWidth2 += width; } );