From 1906809049693dc09ffee9edabce4af5d262bc02 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 5 Feb 2018 15:07:21 +0800 Subject: [PATCH] update collapse animation --- components/_util/openAnimation.js | 5 +---- components/collapse/Collapse.vue | 2 +- components/collapse/src/Panel.vue | 3 ++- components/collapse/src/PanelContent.vue | 1 - components/collapse/src/openAnimationFactory.js | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/_util/openAnimation.js b/components/_util/openAnimation.js index 00be03f36..655629630 100644 --- a/components/_util/openAnimation.js +++ b/components/_util/openAnimation.js @@ -1,4 +1,4 @@ -import cssAnimation from 'css-animation' +import cssAnimation from './css-animation' import getRequestAnimationFrame, { cancelRequestAnimationFrame } from './getRequestAnimationFrame' const reqAnimFrame = getRequestAnimationFrame() @@ -44,9 +44,6 @@ const animation = { leave (node, done) { return animate(node, false, done) }, - // appear (node, done) { - // return animate(node, true, done) - // }, } export default animation diff --git a/components/collapse/Collapse.vue b/components/collapse/Collapse.vue index 4bc4efe4e..f0cb3e6a1 100644 --- a/components/collapse/Collapse.vue +++ b/components/collapse/Collapse.vue @@ -13,7 +13,7 @@ export default { props: { ...collapseProps, bordered: PropTypes.bool.def(true), - openAnimation: PropTypes.any.def({ ...animation, appear () { } }), + openAnimation: PropTypes.any.def(animation), change: PropTypes.func.def(() => {}), accordion: PropTypes.bool, }, diff --git a/components/collapse/src/Panel.vue b/components/collapse/src/Panel.vue index 3334deb02..c3533b780 100644 --- a/components/collapse/src/Panel.vue +++ b/components/collapse/src/Panel.vue @@ -27,7 +27,7 @@ export default { const transitionProps = { props: Object.assign({ - appear: false, + appear: true, css: false, }), on: { ...openAnimation }, @@ -56,6 +56,7 @@ export default { {...transitionProps} > {$slots.default} diff --git a/components/collapse/src/openAnimationFactory.js b/components/collapse/src/openAnimationFactory.js index c8cc8b41a..ff46398ec 100644 --- a/components/collapse/src/openAnimationFactory.js +++ b/components/collapse/src/openAnimationFactory.js @@ -1,4 +1,4 @@ -import cssAnimation from 'css-animation' +import cssAnimation from '../../_util/css-animation' function animate (node, show, transitionName, done) { let height