优化 users-motion

This commit is contained in:
felixpmg
2017-02-12 00:26:38 +08:00
parent d1ffb7e3e9
commit ceabac1a14
2 changed files with 11 additions and 10 deletions
+7 -5
View File
@@ -45,6 +45,7 @@ class list extends React.Component {
}
getBodyWrapper = (body) => {
// 切换分页去除动画;
if (this.currentPage !== this.newPage) {
this.currentPage = this.newPage
return body
@@ -60,6 +61,11 @@ class list extends React.Component {
e.target.style.height = 'auto'
}
async pageChange(pagination) {
await this.props.onPageChange(pagination)
this.newPage = pagination.current
}
render () {
const {
loading,
@@ -133,11 +139,7 @@ class list extends React.Component {
return <div>
<Table className={styles.table} bordered scroll={{
x: 1200
}} columns={columns} dataSource={dataSource} loading={loading} onChange={(page) => {
onPageChange(page, () => {
self.newPage = page.current
})
}} pagination={pagination} simple rowKey={record => record.id} getBodyWrapper={this.getBodyWrapper} />
}} columns={columns} dataSource={dataSource} loading={loading} onChange={::this.pageChange} pagination={pagination} simple rowKey={record => record.id} getBodyWrapper={this.getBodyWrapper} />
</div>
}
}