完美解决vue-quill-editor初始化自动聚焦问题
一、初始化时令vue-quill-editor失效
mounted() {
this.$refs.myQuillEditor.quill.enable(false)
},
二、点击富文本框时令quill-editor生效,并聚焦
<quill-editor
class="editor"
:class="isFocus ? 'focus-margin' : ''"
v-model="messages"
ref="myQuillEditor"
@click.native="handleEditAble"
@blur="onEditorBlur"
@focus="onEditorFocus"
@ready="onEditorReady">
</quill-editor>
methods: {
handleEditAble() {
if(this.qillInit) {
this.$refs.myQuillEditor.quill.enable(true)
this.$refs.myQuillEditor.quill.focus()
this.qillInit = false
}
},
}