mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-21 15:04:26 +00:00
users-motion rc-tween-one 优化
This commit is contained in:
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ function Users ({ location, dispatch, users }) {
|
||||
dataSource: list,
|
||||
loading,
|
||||
pagination: pagination,
|
||||
location,
|
||||
onPageChange (page) {
|
||||
const { query, pathname } = location
|
||||
dispatch(routerRedux.push({
|
||||
|
||||
Reference in New Issue
Block a user