Commit 7faa69b2 authored by 李纪文's avatar 李纪文

fix: 修改表格

parent a716279b
......@@ -46,7 +46,14 @@ const Demo = () => {
// @ts-ignore
return (
<div style={{ height: '800px' }}>
{!!dataSource.length && <BasicTable dataSource={dataSource} columns={columns} bordered />}
{!!dataSource.length && (
<BasicTable
dataSource={dataSource}
columns={columns}
bordered
pagination={{ current: 1, pageSize: 20, size: 'default' }}
/>
)}
{!dataSource.length && <Empty description={'暂无数据'} />}
</div>
);
......
......@@ -67,7 +67,13 @@ const Demo = () => {
return (
<div style={{ height: '400px' }}>
{!!dataSource.length && (
<BasicTable dataSource={dataSource} columns={columns} bordered summary={Summary} />
<BasicTable
dataSource={dataSource}
columns={columns}
bordered
summary={Summary}
pagination={false}
/>
)}
{!dataSource.length && <Empty description={'暂无数据'} />}
</div>
......
......@@ -7,7 +7,7 @@ import './index.less';
const BasicTable = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table');
const pagination = props.pagination || {};
const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {};
const showTotal = (total) => {
debugger;
return `共 ${Math.ceil(
......@@ -19,7 +19,7 @@ const BasicTable = (props) => {
className={classNames(prefixCls)}
scroll={{ y: 'calc(100% - 40px)' }}
{...props}
pagination={{ showTotal, ...pagination }}
pagination={pagination ? { showTotal, ...pagination } : pagination}
/>
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment