Commit 74204612 authored by 李纪文's avatar 李纪文

fix: 表格增加默认show

parent 3a8ab052
......@@ -7,7 +7,21 @@ import './index.less';
const BasicTable = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table');
return <Table className={classNames(prefixCls)} scroll={{ y: 'calc(100% - 40px)' }} {...props} />;
const pagination = props.pagination || {};
const showTotal = (total) => {
debugger;
return `共 ${Math.ceil(
total / (props.pagination ? props.pagination.pageSize || 10 : 10),
)} 页 / 共 ${total} 条记录`;
};
return (
<Table
className={classNames(prefixCls)}
scroll={{ y: 'calc(100% - 40px)' }}
{...props}
pagination={{ showTotal, ...pagination }}
/>
);
};
BasicTable.defaultProps = {
......
......@@ -138,4 +138,16 @@
border-top: 1px solid #dbe7fb;
}
}
.ant-pagination {
display: flex;
flex-wrap: wrap;
grid-row-gap: 8px;
justify-content: flex-end;
.ant-pagination-total-text {
margin-right: auto;
margin-left: 8px;
}
}
}
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