使用this.$nextTick包起来,原理不清楚,我是加了这个才正常显示的。
//创建
mounted(){
this.$nextTick(()=>{
tinymce.init({
selector: '#' + this.componentKey,
editorId: this.componentKey,
language: 'zh_CN',
width: 400,
height: 200,
placeholder: this.scheme.viewOptions.placeholder,
// 其他配置
})
}
)
}
//销毁时
beforeDestroy () {
tinymce.EditorManager.execCommand('mceRemoveEditor', true, this.componentKey)
},