<template>
<div>
<UEditor :config="config" ref="TheRichText" v-model="content" @beforeInit="addCustomButtom" @ready='ediready'></UEditor>
</div>
</template>
methods: {
//内容获取
ediready(editor) {
editor.setContent(this.content); // 确保UE加载完成后,放入内容。
editor.addListener('contentChange',()=>{
const content = editor.getContent()
// console.log(content)
this.$emit('editorchange',content)
})
},
}
这个@ready不就是渲染完再加载吗,怎么还是要报
Cannot set property 'innerHTML' of undefined
at UE.Editor.setContent