<editor class="editor" id="editor" :style="{'font-size':'14px'}" v-show="!voiceState" @input="onEditor"></editor>
//获取富文本内容
onEditor(){
uni.createSelectorQuery().select('#editor').context((res)=>{
this.content = res.context
this.content.getContents().then(htmlStr=>{
console.log("htmlStr",htmlStr)
})
}).exec()
},
//设置默认内容
uni.createSelectorQuery().select('#editor').context((res)=>{
this.content = res.context
this.content.setContents({
html:""
})
}).exec()
//插入图片
uni.createSelectorQuery().select('#editor').context(res=>{
let editorContext = res.context
// 插入图片
editorContext.insertImage({
src: this.emojiBaseUrl + value, // 图片地址
height:"22px",
width:"22px",
extClass:"extClass" //公共样式图片的class
});
}).exec();