fix: footable height

This commit is contained in:
Zclhlmgqzc 2020-12-08 13:04:21 +08:00
parent 37787b610c
commit 7d0b1b1701
3 changed files with 41 additions and 35 deletions

View File

@ -25,7 +25,7 @@
&.in { &.in {
box-shadow: $Table-fixedLeft-boxShadow; box-shadow: $Table-fixedLeft-boxShadow;
top: 0; top: auto;
} }
& > .#{$ns}Table-table { & > .#{$ns}Table-table {
@ -47,7 +47,7 @@
&.in { &.in {
box-shadow: $Table-fixedRight-boxShadow; box-shadow: $Table-fixedRight-boxShadow;
top: 0; top: auto;
} }
& > .#{$ns}Table-table { & > .#{$ns}Table-table {

View File

@ -137,10 +137,16 @@ export class TableRow extends React.Component<TableRowProps> {
})} })}
> >
<td className={cx(`Table-foot`)} colSpan={footableColSpan}> <td className={cx(`Table-foot`)} colSpan={footableColSpan}>
{ignoreFootableContent ? null : (
<table className={cx(`Table-footTable`)}> <table className={cx(`Table-footTable`)}>
<tbody> <tbody>
{columns.map(column => ( {ignoreFootableContent
? columns.map(column => (
<tr key={column.index}>
{column.label !== false ? <th></th> : null}
<td></td>
</tr>
))
: columns.map(column => (
<tr key={column.index}> <tr key={column.index}>
{column.label !== false ? ( {column.label !== false ? (
<th> <th>
@ -169,7 +175,6 @@ export class TableRow extends React.Component<TableRowProps> {
))} ))}
</tbody> </tbody>
</table> </table>
)}
</td> </td>
</tr> </tr>
); );

View File

@ -790,8 +790,9 @@ export default class Table extends React.Component<TableProps, object> {
const dom = findDOMNode(this) as HTMLElement; const dom = findDOMNode(this) as HTMLElement;
forEach( forEach(
// 折叠 footTable 不需要改变
dom.querySelectorAll( dom.querySelectorAll(
`.${ns}Table-fixedTop table, .${ns}Table-fixedLeft table, .${ns}Table-fixedRight table` `.${ns}Table-fixedTop table, .${ns}Table-fixedLeft>table, .${ns}Table-fixedRight>table`
), ),
(table: HTMLTableElement) => { (table: HTMLTableElement) => {
let totalWidth = 0; let totalWidth = 0;