mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
chore: tab 里面直接写 type, 虽然是一种不推荐的用法,但是还是兼容一下 (#2256)
This commit is contained in:
parent
3b477cda35
commit
a90bb85c6c
@ -389,7 +389,8 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
'formInited',
|
||||
'simpleMode',
|
||||
'inputOnly',
|
||||
'value'
|
||||
'value',
|
||||
'actions'
|
||||
];
|
||||
|
||||
hooks: {
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user