跳到主要内容

API

Props 说明

参数说明类型默认值
value编辑框内容EditorStatenull
defaultValue编辑框默认内容EditorStatenull
placeholder占位符stringnull
id唯一标识stringnull
editorId唯一标识stringnull
readOnly只读booleanfalse
language语言'zh'、'zh-hant'、'en'、'tr'、'ru'、'jpn'、'kr'、'pl'、'fr'、'vi-vn''en'
controls工具栏控件列表ControlItem[][]
excludeControls排除内置控件列表BuiltInControlNames[]
extendControls扩展控件列表ControlItem[][]
componentBelowControlBar工具栏下方扩展区域React.ReactNodenull
media媒体选项MediaTypenull
imageControls图片操作工具栏ImageControlItem[]null
imageResizable图片是否可调整尺寸booleantrue
imageEqualRatiobooleantrue
headings标题级别选项string[]
colors颜色列表string[]
fontSizes字体大小列表number[]
fontFamilies字体列表Array<{ name: string, family: string }>
lineHeights行高选项列表number[]
textAligns文字排版方向选项列表string[]
letterSpacings字符间距列表number[]
emojisemoji 列表string[]
draftPropsEditorProps
blockRenderMapImmutable.Map | Function
blockRendererFnFunction
customStyleMapImmutable.Map | Function
customStyleFnFunction
blockStyleFnFunction
keyBindingFnFunction
colorPickerAutoHidebooleantrue
colorPicker
converts
hooks
textBackgroundColorboolean
allowInsertLinkTextbooleanfalse
defaultLinkTargetstring
stripPastedStylesbooleanfalse
fixPlaceholderbooleanfalse
className类名string
style内联样式React.CSSPropertiesnull
controlBarClassName工具栏类名string
controlBarStyle工具栏内联样式React.CSSPropertiesnull
contentClassName内容区类名string
contentStyle内容区内联样式React.CSSPropertiesnull
onChange变更回调(editorState: EditorState) => void
onFocus聚焦回调函数Function
onBlur失焦回调函数Function
onTabFunction
onDeleteFunction
onSaveFunction
onFullscreenFunction
handlePastedFilesFunction
handleDroppedFilesFunction
handlePastedTextFunction
handleBeforeInputFunction
handleReturnFunction
handleKeyCommandFunction
codeTabIndentsnumber
disabled是否禁用numberfalse
extendAtomics