Browse Source

Update demo.

pull/598/head
Yuwei Ba 9 years ago
parent
commit
83f176f2f6
  1. 6
      components/pagination/demo/basic.md
  2. 6
      components/pagination/demo/changer.md
  3. 6
      components/pagination/demo/jump.md
  4. 6
      components/pagination/demo/locale.md
  5. 6
      components/pagination/demo/mini.md
  6. 6
      components/pagination/demo/more.md
  7. 6
      components/pagination/demo/simple.md
  8. 26
      components/pagination/demo/uncontrolled.md

6
components/pagination/demo/basic.md

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

6
components/pagination/demo/changer.md

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

6
components/pagination/demo/jump.md

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

6
components/pagination/demo/locale.md

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

6
components/pagination/demo/mini.md

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

6
components/pagination/demo/more.md

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

6
components/pagination/demo/simple.md

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

26
components/pagination/demo/uncontrolled.md

@ -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…
Cancel
Save