vue中引入使用wangEditor

官网介绍:wangEditor - 轻量级 web 富文本编辑器

使用步骤:

第一步:安装富文本编辑器

npm install wangeditor

第二步:在需要使用的组件中引入编辑器

import E from "wangeditor"

第三步:记住,在mounted()中使用,因为需要操作dom

//初始化        
this.editor = new E('#editor')
this.editor.create()

第四步:获取输入框的内容:

console.log(this.editor.txt.html());

整体代码:


你可能感兴趣的:(工作类,vue.js,前端,javascript)