基本使用

下载

npm 安装 npm i wangeditor --save

CDN 链接 https://unpkg.com/wangeditor/dist/wangEditor.min.js

使用 js 外链引入

<div id="div1">
    <p>欢迎使用 <b>wangEditor</b> 富文本编辑器</p>
</div>

<script type="text/javascript" src="//unpkg.com/wangeditor/dist/wangEditor.min.js"></script>
<script type="text/javascript">
    const E = window.wangEditor
    const editor = new E('#div1')
    // 或者 const editor = new E( document.getElementById('div1') )
    editor.create()
</script>

使用 npm 安装

import E from 'wangeditor'
const editor = new E('#div1')
// 或者 const editor = new E( document.getElementById('div1') )
editor.create()
Copyright © wangEditor (2020 - present) all right reserved,powered by GitbookFile Modify: 2020-10-21 16:30:01

results matching ""

    No results matching ""