chore: tab 里面直接写 type, 虽然是一种不推荐的用法,但是还是兼容一下 (#2256)

This commit is contained in:
liaoxuezhi 2021-07-09 20:37:39 +08:00 committed by GitHub
parent 3b477cda35
commit a90bb85c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -389,7 +389,8 @@ export default class Form extends React.Component<FormProps, object> {
'formInited',
'simpleMode',
'inputOnly',
'value'
'value',
'actions'
];
hooks: {

View File

@ -484,7 +484,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
>
{render(
`item/${index}/${tabIndex}`,
tab.tab || tab.body || '',
(tab as any)?.type ? (tab as any) : tab.tab || tab.body,
{
data: ctx,
formMode: tab.mode || subFormMode || formMode,
@ -519,11 +519,15 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
? this.renderTab(tab, this.props, index)
: tabRender
? tabRender(tab, this.props, index)
: render(`tab/${index}`, tab.tab || tab.body || '', {
formMode: tab.mode || subFormMode || formMode,
formHorizontal:
tab.horizontal || subFormHorizontal || formHorizontal
})}
: render(
`tab/${index}`,
(tab as any)?.type ? (tab as any) : tab.tab || tab.body,
{
formMode: tab.mode || subFormMode || formMode,
formHorizontal:
tab.horizontal || subFormHorizontal || formHorizontal
}
)}
</Tab>
) : null
);