mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-30 03:08:31 +08:00
feat: keep line breaks in the field description
This commit is contained in:
parent
5d9976b35e
commit
4c2df15da2
@ -7,11 +7,24 @@ import { useCompile, useDesignable } from '../..';
|
||||
import { useCollection, useCollectionManager } from '../../../collection-manager';
|
||||
import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings';
|
||||
import { BlockItem } from '../block-item';
|
||||
import { HTMLEncode } from '../input/shared';
|
||||
|
||||
export const FormItem: any = (props) => {
|
||||
const field = useField();
|
||||
return (
|
||||
<BlockItem className={'nb-form-item'}>
|
||||
<Item {...props} />
|
||||
<Item
|
||||
{...props}
|
||||
extra={
|
||||
field.description ? (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: HTMLEncode(field.description).split('\n').join('<br/>'),
|
||||
}}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
</BlockItem>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user