fix(grid-card, list): display title only work on current block (#1942)

This commit is contained in:
Dunqing 2023-05-29 11:22:38 +08:00 committed by GitHub
parent c0f9c8116a
commit 6d326f424a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ export const FormItem: any = observer((props: any) => {
} }
} }
}, []); }, []);
const { showTitle = true } = props; const showTitle = schema['x-decorator-props']?.showTitle ?? true;
return ( return (
<ACLCollectionFieldProvider> <ACLCollectionFieldProvider>
<BlockItem className={'nb-form-item'}> <BlockItem className={'nb-form-item'}>

View File

@ -55,7 +55,7 @@ export const GeneralSchemaItems: React.FC<{
/> />
)} )}
<SchemaSettings.SwitchItem <SchemaSettings.SwitchItem
checked={field.decoratorProps.showTitle ?? true} checked={fieldSchema['x-decorator-props'] ?? true}
title={t('Display title')} title={t('Display title')}
onChange={(checked) => { onChange={(checked) => {
fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {}; fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {};