From 83f176f2f6292ebb14b39c9ea1e820193682b2d8 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Thu, 26 Nov 2015 17:15:18 +0800 Subject: [PATCH] Update demo. --- components/pagination/demo/basic.md | 6 +---- components/pagination/demo/changer.md | 6 +---- components/pagination/demo/jump.md | 6 +---- components/pagination/demo/locale.md | 6 +---- components/pagination/demo/mini.md | 6 +---- components/pagination/demo/more.md | 6 +---- components/pagination/demo/simple.md | 6 +---- components/pagination/demo/uncontrolled.md | 26 ++++++++++++++++++---- 8 files changed, 29 insertions(+), 39 deletions(-) diff --git a/components/pagination/demo/basic.md b/components/pagination/demo/basic.md index 06b4ebd9c7..e99d942366 100644 --- a/components/pagination/demo/basic.md +++ b/components/pagination/demo/basic.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-basic')); ```` diff --git a/components/pagination/demo/changer.md b/components/pagination/demo/changer.md index 4a9c2e944f..29544db5ce 100644 --- a/components/pagination/demo/changer.md +++ b/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( - , + , document.getElementById('components-pagination-demo-changer')); ```` diff --git a/components/pagination/demo/jump.md b/components/pagination/demo/jump.md index b58f7f9ca7..7961acd82c 100644 --- a/components/pagination/demo/jump.md +++ b/components/pagination/demo/jump.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-jump')); ```` diff --git a/components/pagination/demo/locale.md b/components/pagination/demo/locale.md index 4d185ff654..edb15f56e4 100644 --- a/components/pagination/demo/locale.md +++ b/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( - , + , document.getElementById('components-pagination-demo-locale')); ```` diff --git a/components/pagination/demo/mini.md b/components/pagination/demo/mini.md index 208053ad5b..8b1b693a06 100644 --- a/components/pagination/demo/mini.md +++ b/components/pagination/demo/mini.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-mini')); ```` diff --git a/components/pagination/demo/more.md b/components/pagination/demo/more.md index 62a91e7c2b..8ac0d91c7f 100644 --- a/components/pagination/demo/more.md +++ b/components/pagination/demo/more.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-more')); ```` diff --git a/components/pagination/demo/simple.md b/components/pagination/demo/simple.md index 5b91630dec..6f1a08f05b 100644 --- a/components/pagination/demo/simple.md +++ b/components/pagination/demo/simple.md @@ -9,11 +9,7 @@ ````jsx import { Pagination } from 'antd'; -function onChange(page) { - console.log(page); -} - ReactDOM.render( - , + , document.getElementById('components-pagination-demo-simple')); ```` diff --git a/components/pagination/demo/uncontrolled.md b/components/pagination/demo/uncontrolled.md index ec71dec5f1..a8187100cc 100644 --- a/components/pagination/demo/uncontrolled.md +++ b/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 ; + } +}); + ReactDOM.render( - , -document.getElementById('components-pagination-demo-uncontrolled')); +, +document.getElementById('components-pagination-demo-aaa')); ```` +