在elementUI的dialog中使用KindEditor
在文本框准备好后初始化
<textarea v-if="editorShow" ref="news" v-model="ruleform.detail" class="infoContent"></textarea>
this.$nextTick(() => {
this.editor = KindEditor.create(this.$refs.news, that.editorOptions);
})
修改时,要重新赋值
this.editorShow = true;
this.$nextTick(() => {
try {
if(this.editor){
this.editor.remove();
}
this.editor = null;
this.editor = KindEditor.create(this.$refs.news, this.editorOptions);
} catch(e) {
this.editor = KindEditor.create(this.$refs.news, this.editorOptions);
}
this.editor.html('');
})