mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
rewrite Pagination demos to es6 component, #4878
This commit is contained in:
parent
e68b54f902
commit
6455bdf6e1
@ -16,22 +16,20 @@ Controlled page number.
|
||||
````jsx
|
||||
import { Pagination } from 'antd';
|
||||
|
||||
const Container = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
current: 3,
|
||||
};
|
||||
},
|
||||
onChange(page) {
|
||||
class App extends React.Component {
|
||||
state = {
|
||||
current: 3,
|
||||
}
|
||||
onChange = (page) => {
|
||||
console.log(page);
|
||||
this.setState({
|
||||
current: page,
|
||||
});
|
||||
},
|
||||
}
|
||||
render() {
|
||||
return <Pagination current={this.state.current} onChange={this.onChange} total={50} />;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<Container />, mountNode);
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
````
|
||||
|
Loading…
Reference in New Issue
Block a user