feat(table): 添加表格高度配置选项

- 为Table组件添加height属性定义
- 实现表格固定高度功能
- 优化滚动逻辑支持手动设置高度
- 移除Page组件children属性可选限制
master
LiuJiaNan 2026-04-20 11:00:57 +08:00
parent df41ef1562
commit 33096eb1c0
3 changed files with 5 additions and 2 deletions

View File

@ -25,7 +25,7 @@ export interface PageProps {
/** 额外底部操作按钮组 */
extraActionButtons?: ReactNode;
/** 内容区域 */
children?: ReactNode | (() => ReactNode);
children: ReactNode | (() => ReactNode);
}
/** 页面布局组件 */

View File

@ -18,6 +18,8 @@ export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, "columns
align?: "left" | "right" | "center";
/** 超过宽度是否自动省略,默认 true */
ellipsis?: boolean;
/** 表格高度,默认自适应 */
height?: number;
};
/**

View File

@ -69,6 +69,7 @@ function Table(props) {
rowKey = "id",
storeIndex,
disabledResizer = false,
height,
...restProps
} = props;
@ -182,7 +183,7 @@ function Table(props) {
search={false}
scroll={{
x: tableWidth,
y: enabledResizer ? tableHeight : undefined,
y: height || (enabledResizer ? tableHeight : undefined),
}}
options={{
reload: false,