ducao-quill

react quill

Usage no npm install needed!

<script type="module">
  import ducaoQuill from 'https://cdn.skypack.dev/ducao-quill';
</script>

README

ducao-quill

下载

npm install ducao-quill

或 yarn add ducao-quill

引入组件

import { MyQuill } from 'ducao-quill'

使用方法

<MyQuill />

支持参数(均为可选参数)

  1. hasToolBar?: boolean

    boolean
    是否启用工具栏

  2. toolBarOptions

    false | ( string[] | { header: number; }[] | { list: string; }[] | { script: string; }[] | { indent: string; }[] | { direction: string; }[] | { size: (string | boolean)[]; }[] | { header: (number | boolean)[]; }[] | object[] | object[] )[] | undefined
    工具栏参数,详情参考 quill 工具栏参数配置

  3. placeholder

    string
    提示标语

  4. style

    React.CSSProperties
    行内样式

  5. className

    string
    类名

  6. onChange

    (length: number, imgTotal: number, content: string) => void
    内容改变时回调方法,参数为纯文本长度,插入图片数量,和内容

  7. bindEditor

    (editor: Quill) => void
    绑定的编辑器,可参考类型为 quill 对象

  8. uploadImage

    (files: FileList | null) => Promise
    自定义图片上传方法,返回值为图片的 url(string 类型)