mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-21 03:15:49 +08:00
fix: fix tabs not displaying properly
This commit is contained in:
parent
9b27d6fc8c
commit
c571dc357b
@ -24,6 +24,10 @@ const TabsImpl: ComponentImpl<Static<typeof TabsPropsSchema>> = props => {
|
||||
}
|
||||
}, [getElement, ref]);
|
||||
|
||||
const slots = Array.isArray(slotsElements.content)
|
||||
? slotsElements.content
|
||||
: [slotsElements.content];
|
||||
|
||||
return (
|
||||
<BaseTabs
|
||||
className={css(customStyle?.content)}
|
||||
@ -37,7 +41,7 @@ const TabsImpl: ComponentImpl<Static<typeof TabsPropsSchema>> = props => {
|
||||
>
|
||||
{tabNames.map((tabName, idx) => (
|
||||
<TabPane key={String(idx)} title={tabName}>
|
||||
{(slotsElements.content as React.ReactElement[])[idx]}
|
||||
{slots[idx]}
|
||||
</TabPane>
|
||||
))}
|
||||
</BaseTabs>
|
||||
|
Loading…
Reference in New Issue
Block a user