安装wangEditor
官方文档:www.wangeditor.com/v5/for-fram…
npm install @wangeditor/editor --save
npm install @wangeditor/editor-for-vue@next --save
Vue3使用editor实例
官方的API文档:www.wangeditor.com/v5/API.html 要想获取 editor,必须等待页面渲染完之后。那么调用官方文档内提供的API就只能等到页面渲染完成的时候
onBeforeUpdate(() => { // 页面渲染完毕
const editor = editorRef.value // 获取 editor ,必须等待它渲染完之后
editor.handleTab = () => editor.insertText(' ')
})
此后即可实现对wangEditor的调整