feat: markdown field
This commit is contained in:
parent
ed296cfc5f
commit
122f6bfdb7
11
packages/app/src/components/form.fields/markdown/index.tsx
Normal file
11
packages/app/src/components/form.fields/markdown/index.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { connect } from '@formily/react-schema-renderer'
|
||||
import React from 'react';
|
||||
import { Input as AntdInput } from 'antd'
|
||||
import { acceptEnum, mapStyledProps, mapTextComponent } from '../shared'
|
||||
|
||||
export const Markdown = connect({
|
||||
getProps: mapStyledProps,
|
||||
getComponent: mapTextComponent
|
||||
})(acceptEnum((props) => <AntdInput.TextArea autoSize={{minRows: 2, maxRows: 12}} {...props}/>))
|
||||
|
||||
export default Markdown
|
@ -25,6 +25,7 @@ import { DraggableTable } from './draggable-table'
|
||||
import { Values } from './values'
|
||||
import { Automations } from './automations'
|
||||
import { Wysiwyg } from './wysiwyg'
|
||||
import { Markdown } from './markdown'
|
||||
|
||||
export const setup = () => {
|
||||
registerFormFields({
|
||||
@ -63,6 +64,7 @@ export const setup = () => {
|
||||
draggableTable: DraggableTable,
|
||||
values: Values,
|
||||
wysiwyg: Wysiwyg,
|
||||
markdown: Markdown,
|
||||
'permissions.actions': Permissions.Actions,
|
||||
'permissions.fields': Permissions.Fields,
|
||||
'permissions.tabs': Permissions.Tabs,
|
||||
|
@ -98,6 +98,19 @@ export const percent = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
export const markdown = {
|
||||
title: 'Markdown',
|
||||
group: 'media',
|
||||
options: {
|
||||
interface: 'markdown',
|
||||
type: 'json',
|
||||
component: {
|
||||
type: 'markdown',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const wysiwyg = {
|
||||
title: '可视化编辑器',
|
||||
group: 'media',
|
||||
|
Loading…
Reference in New Issue
Block a user