* feat: markdown migrate * feat: markdown migrate * feat: add Markdown component into schema components * refactor: modifty Markdown.Void component * refactor: modifty Markdown.Void component * refactor: modifty Markdown.Void component * refactor: modify Markdown.Void component * refactor: modify Markdown.Void component * fix: x-editable=false Co-authored-by: chenos <chenlinxh@gmail.com>
42 lines
878 B
TypeScript
42 lines
878 B
TypeScript
/**
|
|
* title: Markdown
|
|
*/
|
|
import { FormItem } from '@formily/antd';
|
|
import { Markdown, SchemaComponent, SchemaComponentProvider } from '@nocobase/client';
|
|
import React from 'react';
|
|
|
|
const schema = {
|
|
type: 'object',
|
|
properties: {
|
|
input: {
|
|
type: 'string',
|
|
title: `Editable`,
|
|
'x-decorator': 'FormItem',
|
|
'x-component': 'Markdown',
|
|
'x-reactions': {
|
|
target: 'read',
|
|
fulfill: {
|
|
state: {
|
|
value: '{{$self.value}}',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
read: {
|
|
type: 'string',
|
|
title: `Read pretty`,
|
|
'x-read-pretty': true,
|
|
'x-decorator': 'FormItem',
|
|
'x-component': 'Markdown',
|
|
},
|
|
},
|
|
};
|
|
|
|
export default () => {
|
|
return (
|
|
<SchemaComponentProvider components={{ Markdown, FormItem }}>
|
|
<SchemaComponent schema={schema} />
|
|
</SchemaComponentProvider>
|
|
);
|
|
};
|