refactor(arco/Tabs): remove placehoder

In some cases, tabs may not always have slots, so there is no need for placeholders here
This commit is contained in:
xzdry 2022-09-05 10:42:27 +08:00
parent da5d342ef6
commit d6aba768a3

View File

@ -6,7 +6,6 @@ import { FALLBACK_METADATA, getComponentProps } from '../sunmao-helper';
import { TabsPropsSpec as BaseTabsPropsSpec } from '../generated/types/Tabs';
import { useEffect, useRef } from 'react';
import { useStateValue } from '../hooks/useStateValue';
import { EmptyPlaceholder } from './_internal/EmptyPlaceholder';
const TabsPropsSpec = Type.Object(BaseTabsPropsSpec);
const TabsStateSpec = Type.Object({
@ -127,11 +126,7 @@ export const Tabs = implementRuntimeComponent({
key={String(idx)}
title={tabItem.title}
>
{slotsElements?.content?.(
{ tabIndex: idx },
<EmptyPlaceholder />,
`content_${idx}`
) || <EmptyPlaceholder />}
{slotsElements?.content?.({ tabIndex: idx }, undefined, `content_${idx}`)}
</TabPane>
)
)}