修复有超级表头时 itemActions 位置显示不正确的问题

This commit is contained in:
2betop 2020-06-11 19:15:27 +08:00
parent 0e05b829ad
commit 9983812fea

View File

@ -585,10 +585,13 @@ export default class Table extends React.Component<TableProps, object> {
let heights: {
[propName: string]: number;
} = (this.heights = {});
heights.header ||
(heights.header = table.querySelector('thead')!.offsetHeight);
forEach(
table.querySelectorAll('thead>tr:last-child>th'),
(item: HTMLElement) => {
heights.header || (heights.header = item.offsetHeight);
widths[item.getAttribute('data-index') as string] = item.offsetWidth;
}
);