update collapse animation

This commit is contained in:
tangjinzhou 2018-02-05 15:07:21 +08:00
parent a5853c3a21
commit f8f3bcd008
5 changed files with 5 additions and 8 deletions

View File

@ -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

View File

@ -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,
},

View File

@ -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}
>
<PanelContent
v-show={isActive}
prefixCls={prefixCls}
isActive={isActive}
destroyInactivePanel={destroyInactivePanel}

View File

@ -23,7 +23,6 @@ export default {
const contentCls = {
[`${prefixCls}-content`]: true,
[`${prefixCls}-content-active`]: isActive,
[`${prefixCls}-content-inactive`]: !isActive,
}
const child = !isActive && destroyInactivePanel ? null
: <div class={`${prefixCls}-content-box`}>{$slots.default}</div>

View File

@ -1,4 +1,4 @@
import cssAnimation from 'css-animation'
import cssAnimation from '../../_util/css-animation'
function animate (node, show, transitionName, done) {
let height