@bview/mini-editor

1.0.6 • Public • Published

mini-editor

开发:

cd mini-editor

执行:yarn link

执行:yarn build,会自动监听并转译src目录中的es6文件


其他项目中(example demo)使用mini-editor

  • cd demo

  • yarn link mini-editor

  • 项目源文件引入mini-editorimport MiniEditor from 'mini-editor'

一个例子🌰

import MiniEditor from 'mini-editor'
let me = new MiniEditor( document.querySelector('#richEle') , {
        placeholder: '请输入姓名' ,
    } )
// 监听输入事件
me.on( 'input' , this.changeValue )
// 设置富文本的值
me.content( value )
// 只读模式
me.disable( true )

placeholder样式设置,参考Placeholder support for contentEditable elements, without JavaScript。第三点,chrome的br问题,插件已经支持自动检测清理br

Readme

Keywords

none

Package Sidebar

Install

npm i @bview/mini-editor

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

45.4 kB

Total Files

25

Last publish

Collaborators

  • bview