Update demo.

This commit is contained in:
Yuwei Ba 2015-11-26 17:15:18 +08:00
parent 4cc69cdd3f
commit 83f176f2f6
8 changed files with 29 additions and 39 deletions

View File

@ -9,11 +9,7 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination current={1} onChange={onChange} total={50} />,
<Pagination defaultCurrent={1} total={50} />,
document.getElementById('components-pagination-demo-basic'));
````

View File

@ -9,15 +9,11 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
function onShowSizeChange(current, pageSize) {
console.log(current, pageSize);
}
ReactDOM.render(
<Pagination showSizeChanger onShowSizeChange={onShowSizeChange} current={1} onChange={onChange} total={500} />,
<Pagination showSizeChanger onShowSizeChange={onShowSizeChange} defaultCurrent={3} total={500} />,
document.getElementById('components-pagination-demo-changer'));
````

View File

@ -9,11 +9,7 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination showQuickJumper current={2} onChange={onChange} total={500} />,
<Pagination showQuickJumper defaultCurrent={2} total={500} />,
document.getElementById('components-pagination-demo-jump'));
````

View File

@ -10,11 +10,7 @@
import { Pagination } from 'antd';
import enUS from 'antd/lib/pagination/locale/en_US';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination current={1} onChange={onChange} total={50} locale={enUS} />,
<Pagination defaultCurrent={1} total={50} locale={enUS} />,
document.getElementById('components-pagination-demo-locale'));
````

View File

@ -9,11 +9,7 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination size="small" current={1} onChange={onChange} total={50} />,
<Pagination size="small" defaultCurrent={2} total={50} />,
document.getElementById('components-pagination-demo-mini'));
````

View File

@ -9,11 +9,7 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination current={1} onChange={onChange} total={500} />,
<Pagination defaultCurrent={1} total={500} />,
document.getElementById('components-pagination-demo-more'));
````

View File

@ -9,11 +9,7 @@
````jsx
import { Pagination } from 'antd';
function onChange(page) {
console.log(page);
}
ReactDOM.render(
<Pagination simple current={1} onChange={onChange} total={50} />,
<Pagination simple defaultCurrent={2} total={50} />,
document.getElementById('components-pagination-demo-simple'));
````

View File

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