提交 88108b9f 编写于 作者: A afc163

Fix loading icon position in empty table

上级 2dd307af
...@@ -473,12 +473,14 @@ let AntTable = React.createClass({ ...@@ -473,12 +473,14 @@ let AntTable = React.createClass({
return column; return column;
}); });
let emptyText; let emptyText;
let emptyClass = '';
if (!data || data.length === 0) { if (!data || data.length === 0) {
emptyText = <div className="ant-table-empty"> emptyText = <div className="ant-table-placeholder">
<i className="anticon anticon-frown"></i>暂无数据 <i className="anticon anticon-frown"></i>暂无数据
</div>; </div>;
emptyClass = ' ant-table-empty';
} }
return <div className="clearfix"> return <div className={'clearfix' + emptyClass}>
<Table <Table
{...this.props} {...this.props}
data={data} data={data}
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
.@{table-prefix-cls} { .@{table-prefix-cls} {
font-size: @font-size-base; font-size: @font-size-base;
color: @text-color; color: @text-color;
transition: opacity 0.3s ease;
&-body {
transition: opacity 0.3s ease;
}
table { table {
width: 100%; width: 100%;
...@@ -77,10 +80,10 @@ ...@@ -77,10 +80,10 @@
} }
&-loading { &-loading {
.ant-table-body { position: relative;
.@{table-prefix-cls}-body {
opacity: 0.42; opacity: 0.42;
} }
position: relative;
&:after { &:after {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
...@@ -179,13 +182,25 @@ ...@@ -179,13 +182,25 @@
} }
&-empty { &-empty {
position: relative;
margin-bottom: 16px;
}
&-empty &-body {
height: 150px;
}
&-placeholder {
height: 100px; height: 100px;
line-height: 100px; line-height: 100px;
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
color: #999; color: #999;
border-bottom: 1px solid #E9E9E9; border-bottom: 1px solid #E9E9E9;
margin-bottom: 16px; position: absolute;
top: 50px;
left: 0;
width: 100%;
.anticon { .anticon {
margin-right: 4px; margin-right: 4px;
position: relative; position: relative;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册