vue-quill-editor富文本焦点问题

vue-quill-editor富文本渲染完成自动获取焦点,问题在于数据请求完成,富文本内容发生变化从而自动获取焦点html

mounted() { this.$refs.myQuillEditor.quill.enable(false); this.hintGetFun(); }, methods: { onEditorChange({ quill, html, text }) { this.formHint.hintList[this.hintIndex].hintValue = html; }, async hintGetFun() { try { let res = await hintGet(this.$route.params.pk); if (res.data.code == "S00000") { this.formHint.hintList = res.data.data; //富文本编辑器神坑处理
          this.$nextTick(function() { this.$refs.myQuillEditor.quill.enable(true); this.$refs.myQuillEditor.quill.blur(); }); } } catch (err) { console.log(err); } }

数据请求完成执行$nextTick这样就能够完美解决富文本自动获取焦点问题。vue

相关文章
相关标签/搜索