fix(client): collection field does not exist

This commit is contained in:
chenos 2022-03-10 12:01:30 +08:00
parent 91ae780e4f
commit 345080f92e

View File

@ -25,7 +25,7 @@ FormItem.Designer = () => {
const compile = useCompile();
const collectionField = getField(fieldSchema['name']);
const originalTitle = collectionField?.uiSchema?.title;
const targetFields = collectionField.target ? getCollectionFields(collectionField.target) : [];
const targetFields = collectionField?.target ? getCollectionFields(collectionField.target) : [];
const initialValue = {
title: field.title === originalTitle ? undefined : field.title,
};
@ -40,6 +40,7 @@ FormItem.Designer = () => {
}));
return (
<GeneralSchemaDesigner>
{collectionField && (
<SchemaSettings.PopupItem
title={'编辑'}
schema={
@ -127,6 +128,7 @@ FormItem.Designer = () => {
} as ISchema
}
/>
)}
{collectionField?.target && (
<SchemaSettings.SelectItem
title={'标题字段'}
@ -152,7 +154,7 @@ FormItem.Designer = () => {
}}
/>
)}
<SchemaSettings.Divider />
{collectionField && <SchemaSettings.Divider />}
<SchemaSettings.Remove
removeParentsIfNoChildren
breakRemoveOn={{