提交 4c546441 编写于 作者: A afc163

Add empty style for table

上级 f101c323
...@@ -471,13 +471,20 @@ var AntTable = React.createClass({ ...@@ -471,13 +471,20 @@ var AntTable = React.createClass({
column.key = column.dataIndex || i; column.key = column.dataIndex || i;
return column; return column;
}); });
let emptyText;
if (!data || data.length === 0) {
emptyText = <div className="ant-table-empty">
<i className="anticon anticon-frown"></i>暂无数据
</div>;
}
return <div className="clearfix"> return <div className="clearfix">
<Table <Table
{...this.props} {...this.props}
data={data || []} data={data}
columns={columns} columns={columns}
className={classString} className={classString}
/> />
{emptyText}
{this.renderPagination()} {this.renderPagination()}
</div>; </div>;
} }
......
...@@ -176,6 +176,20 @@ ...@@ -176,6 +176,20 @@
} }
} }
} }
&-empty {
height: 100px;
line-height: 100px;
text-align: center;
font-size: 12px;
color: #999;
border-bottom: 1px solid #E9E9E9;
.anticon {
margin-right: 4px;
position: relative;
top: -1px;
}
}
} }
.@{table-prefix-cls}-pagination { .@{table-prefix-cls}-pagination {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册