使用简单
10 行代码即可创建一个功能健全的富文本编辑器,可查看 demo 示例open in new window。如用于 Vue React 可参考这里。
import '@wangeditor/editor/dist/css/style.css'
import { createEditor, createToolbar } from '@wangeditor/editor'
// 创建编辑器
const editor = createEditor({
selector: '#editor-container'
})
// 创建工具栏
const toolbar = createToolbar({
editor,
selector: '#toolbar-container'
})
兼容性
- 兼容主流的 PC 浏览器,如 Chrome Firefox Safari Edge 等
- 暂不支持移动端编辑(支持移动端查看)
- 不再支持 IE 浏览器