Browse Source

update collapse animation

pull/9/head
tangjinzhou 7 years ago
parent
commit
1906809049
  1. 5
      components/_util/openAnimation.js
  2. 2
      components/collapse/Collapse.vue
  3. 3
      components/collapse/src/Panel.vue
  4. 1
      components/collapse/src/PanelContent.vue
  5. 2
      components/collapse/src/openAnimationFactory.js

5
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

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

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

1
components/collapse/src/PanelContent.vue

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

2
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

Loading…
Cancel
Save