Browse Source

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

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

6
components/collapse/Collapse.tsx

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

Loading…
Cancel
Save