feat(table): 添加表格高度配置选项
- 为Table组件添加height属性定义 - 实现表格固定高度功能 - 优化滚动逻辑支持手动设置高度 - 移除Page组件children属性可选限制master
parent
df41ef1562
commit
33096eb1c0
|
|
@ -25,7 +25,7 @@ export interface PageProps {
|
||||||
/** 额外底部操作按钮组 */
|
/** 额外底部操作按钮组 */
|
||||||
extraActionButtons?: ReactNode;
|
extraActionButtons?: ReactNode;
|
||||||
/** 内容区域 */
|
/** 内容区域 */
|
||||||
children?: ReactNode | (() => ReactNode);
|
children: ReactNode | (() => ReactNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 页面布局组件 */
|
/** 页面布局组件 */
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, "columns
|
||||||
align?: "left" | "right" | "center";
|
align?: "left" | "right" | "center";
|
||||||
/** 超过宽度是否自动省略,默认 true */
|
/** 超过宽度是否自动省略,默认 true */
|
||||||
ellipsis?: boolean;
|
ellipsis?: boolean;
|
||||||
|
/** 表格高度,默认自适应 */
|
||||||
|
height?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ function Table(props) {
|
||||||
rowKey = "id",
|
rowKey = "id",
|
||||||
storeIndex,
|
storeIndex,
|
||||||
disabledResizer = false,
|
disabledResizer = false,
|
||||||
|
height,
|
||||||
...restProps
|
...restProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
|
@ -182,7 +183,7 @@ function Table(props) {
|
||||||
search={false}
|
search={false}
|
||||||
scroll={{
|
scroll={{
|
||||||
x: tableWidth,
|
x: tableWidth,
|
||||||
y: enabledResizer ? tableHeight : undefined,
|
y: height || (enabledResizer ? tableHeight : undefined),
|
||||||
}}
|
}}
|
||||||
options={{
|
options={{
|
||||||
reload: false,
|
reload: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue