Skip to content

Commit

Permalink
Merge pull request #11433 from ranwawa/fix/table-auto-fill-height
Browse files Browse the repository at this point in the history
fix: 添加tableFillHeight属性控制表格高度,避免开启autoFillHeight后表格行高度异常的问题,以便向下兼容Closes #11419
  • Loading branch information
hsm-lv authored Dec 27, 2024
2 parents 58974d7 + 8087c4e commit d384ef4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/amis-ui/scss/components/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,10 @@
> .#{$ns}Table-contentWrap {
> .#{$ns}Table-content > table {
border-top: none; // 不然会导致拖动时顶部露出内容
min-height: 100%; // 为了让表格占满高度

&.#{$ns}Table-table--tableFillHeight {
min-height: 100%; // 为了让表格占满高度
}
}

> .#{$ns}Table-content table thead {
Expand Down
4 changes: 3 additions & 1 deletion packages/amis/src/renderers/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,7 @@ export default class Table<
const {
classnames: cx,
tableClassName,
tableFillHeight,
store,
placeholder,
render,
Expand Down Expand Up @@ -2846,7 +2847,8 @@ export default class Table<
'Table-table--checkOnItemClick': checkOnItemClick,
'Table-table--withCombine': store.combineNum > 0,
'Table-table--affixHeader':
affixHeader && !autoFillHeight && store.columnWidthReady
affixHeader && !autoFillHeight && store.columnWidthReady,
'Table-table--tableFillHeight': autoFillHeight && tableFillHeight
},
tableClassName
)}
Expand Down

0 comments on commit d384ef4

Please sign in to comment.