1.0.3 • Published 3 years ago
ducao-quill v1.0.3
ducao-quill
下载
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 类型)