npm install ducao-quill
或 yarn add ducao-quill
import { MyQuill } from 'ducao-quill'
<MyQuill />
-
hasToolBar?: boolean
boolean
是否启用工具栏 -
toolBarOptions
false | ( string[] | { header: number; }[] | { list: string; }[] | { script: string; }[] | { indent: string; }[] | { direction: string; }[] | { size: (string | boolean)[]; }[] | { header: (number | boolean)[]; }[] | object[] | object[] )[] | undefined
工具栏参数,详情参考 quill 工具栏参数配置 -
placeholder
string
提示标语 -
style
React.CSSProperties
行内样式 -
className
string
类名 -
onChange
(length: number, imgTotal: number, content: string) => void
内容改变时回调方法,参数为纯文本长度,插入图片数量,和内容 -
bindEditor
(editor: Quill) => void
绑定的编辑器,可参考类型为 quill 对象 -
uploadImage
(files: FileList | null) => Promise
自定义图片上传方法,返回值为图片的 url(string 类型)