0.0.10 • Published 4 years ago

yanqian-richtext-editor v0.0.10

Weekly downloads
60
License
-
Repository
-
Last release
4 years ago

Note: 燕千云系统用的富文本框,基于quill.js

不多哔哔了,开始吧!

Quickstart

Make sure you have react and react-dom, and some way to load styles, like style-loader. See the documentation on themes for more information.

npm install yanqian-richtext-editor --save

Download

  • npm - npm install yanqian-richtext-editor --save
  • cnpm - cnpm install yanqian-richtext-editor --save

CDN

  冒得CDN咧

Usage

Webpack/ES6

import React from 'react';
import { WYSIWYGEditor } from 'yanqian-richtext-editor';

function MyComponent() {
  const [value, setValue] = useState('');

  return (
    <WYSIWYGEditor
       value={{ 'value' }}
       style={{ width: '100%' }}
       onChange={(value) => { 'value就是delta数据类型, 富文本框的值' }}
       id={'富文本框的id,没有就给1 ==> 适用于一个页面多个富文本框'}
       InfoState = {{
         organizationId: '租户id',
         currentLanguage: '当前语言环境',
       }}
    />
  );
}

Api

nametype默认值描述
valueString-输入框内容
placeholderString请输入文本...占位文本
InfoStateObject-传入{organizationId:'租户id', currentLanguage: '当前语言环境'}
styleObject-编辑器样式
modulesObject-定制的module,可定制toolbar
formatsObject-定制的format,可定制toolbar
readOnlyBooleanfalse只读模式
hiddenToolBarBooleanfalse隐藏工具栏和边框,用于展示
scrollDescriptionsObject-开启输入框滚动条描述
onChangeString: value-内容改变时回调
checkVideoUploadDoneBoolean: value-视频上传完成的回调函数,eg: 返回一个标识,判断能否进行下一步操作
onVideoFileUploadObject : value-视频上传完成的回调函数,返回{fileId: '文件的id' ,fileUrl: '文件的url, url有时效性,建议存fileId'}
promptMessageString : value-抛出信息提示信息方法,返回需要抛出的提示
0.0.5-beta

4 years ago

0.0.4-beta

4 years ago

0.0.10

4 years ago

0.0.3-beta

4 years ago

0.0.2-beta

4 years ago

0.0.1-beta

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago