From d415ed456120c423460f332fe2a0cdb22afa1546 Mon Sep 17 00:00:00 2001 From: jljsj Date: Thu, 10 Sep 2015 11:21:23 +0800 Subject: [PATCH] update enterAnimation demo --- components/enter-animation/demo/basic.md | 1 - components/enter-animation/demo/enter-data.md | 1 - .../enter-animation/demo/router-data.md | 95 +++++++++++++++++++ components/enter-animation/demo/router.md | 58 ++++------- components/enter-animation/index.md | 2 +- 5 files changed, 112 insertions(+), 45 deletions(-) create mode 100644 components/enter-animation/demo/router-data.md diff --git a/components/enter-animation/demo/basic.md b/components/enter-animation/demo/basic.md index 26a28d3c7a..04d36170bc 100644 --- a/components/enter-animation/demo/basic.md +++ b/components/enter-animation/demo/basic.md @@ -94,7 +94,6 @@ React.render( diff --git a/components/enter-animation/demo/router.md b/components/enter-animation/demo/router.md index 4ded398ff8..71e74eb9dc 100644 --- a/components/enter-animation/demo/router.md +++ b/components/enter-animation/demo/router.md @@ -1,6 +1,6 @@ -# Router动画进出场 +# Router默认进出场 -- order: 2 +- order: 3 router组合的进场与出场动画。 @@ -15,43 +15,22 @@ var Link = ReactRouter.Link; var EnterAnimation = antd.EnterAnimation; var App = React.createClass({ - getInitialState: function () { - return { - enter: { - type: 'bottom', - interval: 0.1, - delay: 0, - callback: function (e) { - console.log('我进场了', e.ReactElement.key) - }, - ease: null - }, - leave: null - }; + getInitialState: function () { + return {}; }, - clickPage1() { + clickPage() { this.setState({ - enter: {interval: 0.03,type: 'right',ease: 'cubic-bezier(0.075, 0.82, 0.165, 1)',delay:0.3, - callback: function (e) { - console.log('你点了page1', 'key:'+e.ReactElement.key, e.direction); - } - }, - leave: {type: 'left',upend: true,interval:0.05,duration:0.2,ease: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',delay:0} - }) - }, - clickPage2() { - this.setState({ - enter: {interval: 0.03,type: 'bottom',ease: null,delay:.3,callback: function (e) {console.log('你点了page2', 'key:'+e.ReactElement.key, e.direction);}}, - leave: {delay:0,type:'top'} - }) + enter: {delay:0.3}, + leave: {delay:0} + }); }, render() { var key = this.props.location.pathname; return (
- Page 1 - Page 2 + Page 1 + Page 2
{React.cloneElement(this.props.children ||

Home

这是首页
, {key: key})} @@ -60,23 +39,20 @@ var App = React.createClass({ ); } }); - var Page1 = React.createClass({ render() { - var enterData = {}; return (
-

Page 1

-

A link to page 2 should be active依次进场

-

A link to page 2 should be active依次进场

-

A link to page 2 should be active依次进场

-

A link to page 2 should be active依次进场

-

A link to page 2 should be active改变样式

+

Page 1

+

A link to page 2 should be active依次进场

+

A link to page 2 should be active依次进场

+

A link to page 2 should be active依次进场

+

A link to page 2 should be active依次进场

+

A link to page 2 should be active改变样式

); } }); - var Page2 = React.createClass({ render() { return ( @@ -90,7 +66,6 @@ var Page2 = React.createClass({ ); } }); - React.render(( @@ -103,7 +78,6 @@ React.render((