Yuwei Ba
9 years ago
8 changed files with 29 additions and 39 deletions
@ -1,15 +1,33 @@ |
|||
# 简洁 |
|||
# 受控 |
|||
|
|||
- order: 8 |
|||
|
|||
不受控制的页码。 |
|||
受控制的页码。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { Pagination } from 'antd'; |
|||
|
|||
let Container = React.createClass({ |
|||
getInitialState() { |
|||
return { |
|||
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( |
|||
<Pagination defaultCurrent={3} total={50} />, |
|||
document.getElementById('components-pagination-demo-uncontrolled')); |
|||
<Container />, |
|||
document.getElementById('components-pagination-demo-aaa')); |
|||
```` |
|||
|
|||
|
Loading…
Reference in new issue