<editor id="editor" class="ql-container"@input="getText" showImgToolbar @statuschange="onStatusChange" :read-only="readOnly" @ready="onEditorReady">
</editor>
1.调用
that.onEditorReady();
2.给editor设置初始值
onEditorReady() {var that = this;uni.createSelectorQuery().select('#editor').context((res) => {this.editorCtx = res.context;this.editorCtx.setContents({//赋值html:that.text});}).exec()},
3.获取editor的内容
getText(e){var that = this;console.log(e.detail.html);//带标签内容console.log(e.detail.text);//纯文本内容
},