/** * title: Markdown.Void */ import { FormItem } from '@formily/antd'; import { observer, useField } from '@formily/react'; import { Markdown, SchemaComponent, SchemaComponentProvider } from '@nocobase/client'; import { Button } from 'antd'; import React from 'react'; const schema = { type: 'object', properties: { markdown: { type: 'void', title: `Read pretty`, 'x-decorator': 'Editable', 'x-component': 'Markdown.Void', 'x-editable': false, 'x-component-props': { content: '# Markdown content', }, }, }, }; const Editable = observer((props: any) => { const filed = useField(); if (filed.editable) { return props.children; } return (
{props.children}
); }); export default () => { return ( ); };