rewrite Pagination demos to es6 component, #4878

This commit is contained in:
afc163 2017-02-20 22:14:47 +08:00
parent e68b54f902
commit 6455bdf6e1

View File

@ -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);
````