mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
Update demo.
This commit is contained in:
parent
4cc69cdd3f
commit
83f176f2f6
@ -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'));
|
||||
````
|
||||
|
@ -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
Block a user