Commit dcf8ae65 authored by 涂茜's avatar 涂茜

fix: update table

parent a834a2fe
Pipeline #25681 passed with stages
in 4 minutes 11 seconds
...@@ -45,7 +45,7 @@ const Demo = () => { ...@@ -45,7 +45,7 @@ const Demo = () => {
return ( return (
<div style={{ height: '400px' }}> <div style={{ height: '400px' }}>
{!!dataSource.length && ( {!!dataSource.length && (
<BasicTable dataSource={dataSource} columns={columns} scroll={{ y: 294 }} /> <BasicTable dataSource={dataSource} columns={columns} bordered={true} />
)} )}
{!dataSource.length && <Empty description={'暂无数据'} />} {!dataSource.length && <Empty description={'暂无数据'} />}
</div> </div>
......
...@@ -8,7 +8,7 @@ const BasicTable = (props) => { ...@@ -8,7 +8,7 @@ const BasicTable = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table'); const prefixCls = getPrefixCls('basic-table');
return <Table className={classNames(prefixCls)} {...props} bordered />; return <Table className={classNames(prefixCls)} scroll={{ y: 'calc(100% - 40px)' }} {...props} />;
}; };
BasicTable.defaultProps = { BasicTable.defaultProps = {
......
...@@ -2,16 +2,21 @@ ...@@ -2,16 +2,21 @@
@basic-table-prefix-cls: ~'@{ant-prefix}-basic-table'; @basic-table-prefix-cls: ~'@{ant-prefix}-basic-table';
.@{basic-table-prefix-cls} { .@{basic-table-prefix-cls} {
display: flex;
flex-direction: column;
height: 100%; height: 100%;
overflow: hidden;
.ant-table-wrapper, .ant-table-wrapper,
.ant-spin-nested-loading, .ant-spin-nested-loading,
.ant-spin-container { .ant-spin-container,
height: 100%; .ant-table,
} .ant-table-container,
.ant-table-content {
.ant-table.ant-table-bordered { display: flex;
height: calc(100% - 64px); flex: 1;
flex-direction: column;
overflow: hidden;
} }
.ant-table-tbody > tr { .ant-table-tbody > tr {
...@@ -22,10 +27,6 @@ ...@@ -22,10 +27,6 @@
background: rgba(255, 255, 255, 0); background: rgba(255, 255, 255, 0);
} }
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
background: rgba(255, 255, 255, 0);
}
.ant-table-thead > tr > th { .ant-table-thead > tr > th {
font-weight: 600; font-weight: 600;
background: white; background: white;
...@@ -37,7 +38,10 @@ ...@@ -37,7 +38,10 @@
.ant-table tfoot > tr > th, .ant-table tfoot > tr > th,
.ant-table tfoot > tr > td { .ant-table tfoot > tr > td {
padding: 8px 8px; padding: 8px 8px;
border-right: 1px solid #dbe7fb; }
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
background: rgba(255, 255, 255, 0);
} }
.ant-table-tbody > tr:nth-child(2n-1) { .ant-table-tbody > tr:nth-child(2n-1) {
...@@ -48,6 +52,10 @@ ...@@ -48,6 +52,10 @@
background: #edf2ff; background: #edf2ff;
} }
.ant-table-tbody > tr > td {
border-bottom: 1px solid #dbe7fb;
}
.ant-table.ant-table-bordered .ant-table.ant-table-bordered
> .ant-table-container > .ant-table-container
> .ant-table-content > .ant-table-content
...@@ -116,8 +124,4 @@ ...@@ -116,8 +124,4 @@
border-right: 0; border-right: 0;
border-bottom: 0; border-bottom: 0;
} }
.ant-table-tbody > tr > td {
border-bottom: 1px solid #dbe7fb;
}
} }
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