<editor id="editor" class="ql-container text-cyan radius" @ready="onEditorReady" @input='contentChange' :read-only='false'></editor>
<script>
methods:{
onEditorReady() {
uni.createSelectorQuery().select('#editor').context((res) => {
console.log(res)
this.editorCtx =res.context;
let content={
html:`<p wx:nodeid="70">import AceRow from "@/xx/Ace_Row"</p><p wx:nodeid="73">components:{</p><p wx:nodeid="79" style='white-space:pre;'> AceRow</p><p wx:nodeid="76">}</p><p wx:nodeid="76"><br></p><p wx:nodeid="13"><Ace-Row :gutter='10'></p><p wx:nodeid="66" style='white-space:pre;'> <Ace-Col :span='5' :offset='1' ></Ace-Col> </p><p wx:nodeid="68"></Ace-Row></p>`
}
this.editorCtx.setContents(content);//设置富文本编辑器的内容
}).exec()
},
contentChange(e){
console.log(e.detail)
}
}
</script><editor id="editor" class="ql-container text-cy