fix: workflow tabs not exists (#3889)

This commit is contained in:
jack zhang 2024-04-01 11:31:54 +08:00 committed by GitHub
parent 25c902b2a7
commit 28ca702ab9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ export const Tabs: any = observer(
label: <RecursionField name={key} schema={schema} onlyRenderSelf />, label: <RecursionField name={key} schema={schema} onlyRenderSelf />,
children: ( children: (
<PaneRoot key={key} {...(PaneRoot !== React.Fragment ? { active: key === contextProps.activeKey } : {})}> <PaneRoot key={key} {...(PaneRoot !== React.Fragment ? { active: key === contextProps.activeKey } : {})}>
<SchemaComponent schema={schema} distributed /> <SchemaComponent name={key} schema={schema} onlyRenderProperties distributed />
</PaneRoot> </PaneRoot>
), ),
}; };

View File

@ -3,7 +3,7 @@ import { useComponent, useDesignable } from '.';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { SchemaToolbar } from '../../schema-settings'; import { SchemaToolbar } from '../../schema-settings';
const Def = () => null; const DefaultSchemaToolbar = () => null;
export const useDesigner = () => { export const useDesigner = () => {
const { designable } = useDesignable(); const { designable } = useDesignable();
@ -16,9 +16,9 @@ export const useDesigner = () => {
if (fieldSchema['x-settings']) { if (fieldSchema['x-settings']) {
return SchemaToolbar; return SchemaToolbar;
} }
return Def; return DefaultSchemaToolbar;
}, [fieldSchema]); }, [fieldSchema]);
const component = useComponent(toolbar); const component = useComponent(toolbar);
return designable ? component || Def : Def; return designable ? component || DefaultSchemaToolbar : DefaultSchemaToolbar;
}; };