提交 83f176f2 编写于 作者: Y Yuwei Ba

Update demo.

上级 4cc69cdd
......@@ -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'));
````
......@@ -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'));
````
......@@ -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'));
````
......@@ -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'));
````
......@@ -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'));
````
......@@ -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'));
````
......@@ -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'));
````
# 简洁
# 受控
- 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'));
````
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册