Skip to content

Commit 2510608

Browse files
authored
fix(collapse): custom prefix in animation (#7074)
1 parent b22875d commit 2510608

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/collapse/Collapse.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export default defineComponent({
4242
accordion: false,
4343
destroyInactivePanel: false,
4444
bordered: true,
45-
openAnimation: collapseMotion('ant-motion-collapse', false),
4645
expandIconPosition: 'start',
4746
}),
4847
slots: Object as CustomSlotsType<{
@@ -61,7 +60,7 @@ export default defineComponent({
6160
},
6261
{ deep: true },
6362
);
64-
const { prefixCls, direction } = useConfigInject('collapse', props);
63+
const { prefixCls, direction, rootPrefixCls } = useConfigInject('collapse', props);
6564

6665
// style
6766
const [wrapSSR, hashId] = useStyle(prefixCls);
@@ -131,6 +130,7 @@ export default defineComponent({
131130
if (isEmptyElement(child)) return;
132131
const activeKey = stateActiveKey.value;
133132
const { accordion, destroyInactivePanel, collapsible, openAnimation } = props;
133+
const animation = openAnimation || collapseMotion(`${rootPrefixCls.value}-motion-collapse`);
134134

135135
// If there is no key provide, use the panel order as default key
136136
const key = String(child.key ?? index);
@@ -161,7 +161,7 @@ export default defineComponent({
161161
isActive,
162162
prefixCls: prefixCls.value,
163163
destroyInactivePanel,
164-
openAnimation,
164+
openAnimation: animation,
165165
accordion,
166166
onItemClick: mergeCollapsible === 'disabled' ? null : onClickItem,
167167
expandIcon: renderExpandIcon,

0 commit comments

Comments
 (0)