users-motion rc-tween-one 优化

This commit is contained in:
felixpmg
2017-02-12 14:49:47 +08:00
parent ceabac1a14
commit 26bff8fbb7
2 changed files with 5 additions and 11 deletions
+4 -11
View File
@@ -39,15 +39,13 @@ class list extends React.Component {
ease: 'easeOutQuad'
}
]
const {current} = this.props.pagination
this.currentPage = current
this.newPage = current
}
getBodyWrapper = (body) => {
// 切换分页去除动画;
if (this.currentPage !== this.newPage) {
this.currentPage = this.newPage
const { page = 1 } = this.props.location.query
const { current } = this.props.pagination
if(current != +page) {
return body
}
return (
@@ -61,11 +59,6 @@ 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,
@@ -139,7 +132,7 @@ class list extends React.Component {
return <div>
<Table className={styles.table} bordered scroll={{
x: 1200
}} columns={columns} dataSource={dataSource} loading={loading} onChange={::this.pageChange} pagination={pagination} simple rowKey={record => record.id} getBodyWrapper={this.getBodyWrapper} />
}} columns={columns} dataSource={dataSource} loading={loading} onChange={onPageChange} pagination={pagination} simple rowKey={record => record.id} getBodyWrapper={this.getBodyWrapper} />
</div>
}
}
+1
View File
@@ -30,6 +30,7 @@ function Users ({ location, dispatch, users }) {
dataSource: list,
loading,
pagination: pagination,
location,
onPageChange (page) {
const { query, pathname } = location
dispatch(routerRedux.push({