fix(collapse): custom prefix in animation (#7074)

pull/7102/head
Konv Suu 1 year ago committed by GitHub
parent b22875db33
commit 2510608665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,7 +42,6 @@ export default defineComponent({
accordion: false, accordion: false,
destroyInactivePanel: false, destroyInactivePanel: false,
bordered: true, bordered: true,
openAnimation: collapseMotion('ant-motion-collapse', false),
expandIconPosition: 'start', expandIconPosition: 'start',
}), }),
slots: Object as CustomSlotsType<{ slots: Object as CustomSlotsType<{
@ -61,7 +60,7 @@ export default defineComponent({
}, },
{ deep: true }, { deep: true },
); );
const { prefixCls, direction } = useConfigInject('collapse', props); const { prefixCls, direction, rootPrefixCls } = useConfigInject('collapse', props);
// style // style
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);
@ -131,6 +130,7 @@ export default defineComponent({
if (isEmptyElement(child)) return; if (isEmptyElement(child)) return;
const activeKey = stateActiveKey.value; const activeKey = stateActiveKey.value;
const { accordion, destroyInactivePanel, collapsible, openAnimation } = props; const { accordion, destroyInactivePanel, collapsible, openAnimation } = props;
const animation = openAnimation || collapseMotion(`${rootPrefixCls.value}-motion-collapse`);
// If there is no key provide, use the panel order as default key // If there is no key provide, use the panel order as default key
const key = String(child.key ?? index); const key = String(child.key ?? index);
@ -161,7 +161,7 @@ export default defineComponent({
isActive, isActive,
prefixCls: prefixCls.value, prefixCls: prefixCls.value,
destroyInactivePanel, destroyInactivePanel,
openAnimation, openAnimation: animation,
accordion, accordion,
onItemClick: mergeCollapsible === 'disabled' ? null : onClickItem, onItemClick: mergeCollapsible === 'disabled' ? null : onClickItem,
expandIcon: renderExpandIcon, expandIcon: renderExpandIcon,

Loading…
Cancel
Save