Skip to content

Commit 5bea601

Browse files
committed
perf: collapse animate
1 parent 61a4db3 commit 5bea601

File tree

3 files changed

+4
-71
lines changed

3 files changed

+4
-71
lines changed

components/_util/collapseMotion.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { nextTick } from 'vue';
22
import { addClass, removeClass } from '../vc-util/Dom/class';
33
import type { CSSMotionProps } from './transition';
44

5-
const collapseMotion = (name = 'ant-motion-collapse'): CSSMotionProps => {
5+
const collapseMotion = (name = 'ant-motion-collapse', appear = true): CSSMotionProps => {
66
return {
77
name,
8-
appear: true,
8+
appear,
99
css: true,
1010
onBeforeEnter: (node: HTMLDivElement) => {
1111
node.style.height = '0px';

components/_util/openAnimation.js

-67
This file was deleted.

components/collapse/Collapse.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { computed, defineComponent, ref, watch } from 'vue';
1313
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
1414
import firstNotUndefined from '../_util/firstNotUndefined';
1515
import classNames from '../_util/classNames';
16-
import animation from '../_util/openAnimation';
1716
import useConfigInject from '../_util/hooks/useConfigInject';
1817
import type { CollapsePanelProps } from './CollapsePanel';
18+
import collapseMotion from '../_util/collapseMotion';
1919

2020
type Key = number | string;
2121

@@ -37,7 +37,7 @@ export default defineComponent({
3737
accordion: false,
3838
destroyInactivePanel: false,
3939
bordered: true,
40-
openAnimation: animation,
40+
openAnimation: collapseMotion('ant-motion-collapse', false),
4141
expandIconPosition: 'left',
4242
}),
4343
slots: ['expandIcon'],

0 commit comments

Comments
 (0)