diff --git a/packages/semi-ui-vue/src/components/tabs/TabPane.tsx b/packages/semi-ui-vue/src/components/tabs/TabPane.tsx index 1cd63010..cdc90040 100644 --- a/packages/semi-ui-vue/src/components/tabs/TabPane.tsx +++ b/packages/semi-ui-vue/src/components/tabs/TabPane.tsx @@ -71,8 +71,9 @@ const TabPane = defineComponent({ return lazyRender ? _active : true; }; + const ChildCache = defineComponent(() => () => slots.default?.()); + return () => { - const children = slots.default?.(); const { tabPaneMotion: motion, tabPosition, prevActiveKey } = context.value; const { className, style, itemKey, tabIndex, ...restProps } = props; const active = context.value.activeKey === itemKey; @@ -103,6 +104,7 @@ const TabPane = defineComponent({ (tabPane) => tabPane.itemKey === prevActiveKey ); const hasMotion = motion && active && !isActivatedBecauseOtherTabPaneRemoved && !context.value.forceDisableMotion; + return (