diff --git a/components/enter-animation/demo/basic.md b/components/enter-animation/demo/basic.md index f566425ef6..e54a53acb1 100644 --- a/components/enter-animation/demo/basic.md +++ b/components/enter-animation/demo/basic.md @@ -4,7 +4,6 @@ 默认子节点进场动画。为避免与本站页面的进场冲突,所以 `EnterAnimation` 里延时 1 秒,递增 `interval` 为 0.3。 -刷新页面看效果。 --- @@ -12,47 +11,77 @@ var EnterAnimation = antd.EnterAnimation; var Test = React.createClass({ + getInitialState(){ + return { + direction:'enter', + upend:false, + type:'right', + interval:0.3 + } + }, + onEnter(){ + this.setState({ + direction:'enter', + upend:false, + type:'right', + interval:0.3 + }) + }, + onLeave(){ + this.setState({ + direction:'leave', + upend:false, + type:'left', + interval:.1 + }) + }, render() { return ( - -
-
- - logo -
- +
+
+ +
-
-
我是标题
-
+ +
+
+ + logo +
  • +
  • +
-
我是标题
-
-
-
+
+
我是标题
+
  • -
  • -
+
我是标题
+
+
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
-
-
- +
+ +
); } }); diff --git a/components/enter-animation/demo/enter-data.md b/components/enter-animation/demo/enter-data.md index 441b6b8d06..e2e762b487 100644 --- a/components/enter-animation/demo/enter-data.md +++ b/components/enter-animation/demo/enter-data.md @@ -4,7 +4,6 @@ 通过加上 `enter-data` 属性来指定需要动画进场的元素,并且可以定义每个元素的动画效果,用到的参数有 `type` `queueId` `delay`。 -刷新页面看效果。 --- @@ -12,9 +11,42 @@ var EnterAnimation = antd.EnterAnimation; var Test = React.createClass({ + getInitialState(){ + return { + direction:'enter', + upend:false, + type:'right', + interval:0.1, + delay:0.7 + } + }, + onEnter(){ + this.setState({ + direction:'enter', + upend:false, + type:'right', + interval:0.05, + delay:0.7 + }) + }, + onLeave(){ + this.setState({ + direction:'leave', + upend:false, + type:'right', + interval:.03, + delay:0.1 + }) + + }, render() { return ( - +
+
+ + +
+
@@ -37,7 +69,7 @@ var Test = React.createClass({
  • -
    我是标题
    +
    我是标题
    @@ -53,6 +85,7 @@ var Test = React.createClass({
    +
    ) } }); diff --git a/components/enter-animation/demo/enter-from.md b/components/enter-animation/demo/enter-from.md new file mode 100644 index 0000000000..0d6009d5fc --- /dev/null +++ b/components/enter-animation/demo/enter-from.md @@ -0,0 +1,112 @@ +# 表单动画进场 + +- order: 2 + +表单组全合的进场与出场动画。 + +--- + +````jsx +var EnterAnimation = antd.EnterAnimation; +var Select = antd.Select; +var Option = Select.Option; +var Checkbox = antd.Checkbox; +var Radio = antd.Radio; +var RadioGroup = antd.RadioGroup; + +var Test = React.createClass({ + getInitialState(){ + return { + direction:'enter', + upend:false, + type:'right', + interval:0.1, + callback:null + } + }, + onEnter(){ + this.setState({ + direction:'enter', + upend:false, + type:'right', + callback:null + }) + }, + onLeave(){ + this.setState({ + direction:'leave', + upend:true, + type:'bottom', + callback:function (){ + console.log('出场结束'); + } + }) + }, + render() { + return ( +
    +
    + + +
    +
    + +
    + +
    +

    大眼萌 minion

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + + 男的 + 女的 + +
    +
    +
    + +
    + +

    随便写点什么

    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + ) + } +}); + +React.render( +, document.getElementById('components-enter-animation-demo-enter-from')); +```` + + diff --git a/components/enter-animation/index.md b/components/enter-animation/index.md index 6e300b3695..df45f8278a 100644 --- a/components/enter-animation/index.md +++ b/components/enter-animation/index.md @@ -55,10 +55,11 @@ |eStyle |string |null |同上, style 的样式动画, `type` 有值,此项无效| |direction |string |`enter`|动画进场或出场样式,以 `enter` `leave` 两值| |duration |number |0.5 |每个动画的时间| -|ease |string|`cubic-bezier(0.165, 0.84, 0.44, 1);`|样式缓动;| +|ease |string|`cubic-bezier(0.165, 0.84, 0.44, 1);`|样式缓动,只支持 css 样式缓动;| |delay |number |0 |整个区块的延时,以秒为单位| |upend |boolean|false |是否倒放,从最后一个dom开始往上播放| |interval |number |0.1 |递增延时值,以秒为单位| +|callback |function|null |动画结束回调| ### enter-data diff --git a/package.json b/package.json index 94b663c3c4..a45638bf28 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "license": "MIT", "dependencies": { "css-animation": "~1.1.0", - "enter-animation": "~0.2.5", + "enter-animation": "~0.3.0", "gregorian-calendar": "~3.0.0", "gregorian-calendar-format": "~3.0.1", "is-equal-shallow": "~0.1.3",