mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
update paging
This commit is contained in:
parent
518bf992ba
commit
17aabfa070
@ -28,13 +28,12 @@ for (let i=0; i<22; i++) {
|
||||
data.push({
|
||||
name: '李大嘴' + i,
|
||||
age: 32,
|
||||
address: '西湖区湖底公园' + i + ' 号'
|
||||
address: '西湖区湖底公园' + i + '号'
|
||||
});
|
||||
}
|
||||
|
||||
var pagination = {
|
||||
total: data.length,
|
||||
pageSize: 10
|
||||
total: data.length
|
||||
};
|
||||
|
||||
React.render(<Table columns={columns} dataSource={data} pagination={pagination} />
|
||||
|
@ -34,7 +34,6 @@ let AntTable = React.createClass({
|
||||
pagination = false;
|
||||
} else {
|
||||
pagination = this.props.pagination || {};
|
||||
pagination.current = pagination.current || 1;
|
||||
pagination.pageSize = pagination.pageSize || 10;
|
||||
}
|
||||
return {
|
||||
@ -135,6 +134,8 @@ let AntTable = React.createClass({
|
||||
}
|
||||
},
|
||||
handlePageChange: function(current) {
|
||||
console.log(current);
|
||||
current = current || 1;
|
||||
let pageSize = this.state.pagination.pageSize;
|
||||
this.setState({
|
||||
data: this.props.dataSource.filter(function(item, i) {
|
||||
|
Loading…
Reference in New Issue
Block a user