diff --git a/src/components/uEditor/UEditor.vue b/src/components/uEditor/UEditor.vue index 7cb6171..ea70a43 100644 --- a/src/components/uEditor/UEditor.vue +++ b/src/components/uEditor/UEditor.vue @@ -93,7 +93,7 @@ export default { UE.getEditor(this.id).ready(() => { console.log('aaa', UE.getEditor(this.id)) // 火狐浏览器格式刷会有问题,让页面失去焦点解决该问题 - UE.getEditor(this.id).body.addEventListener('blur', this.editorBlur) + this.$refs.editorBoxRef.querySelector('.edui-for-formatmatch').addEventListener('click', this.editorBlur) if (_this.fontfamily !== '') { UE.getEditor(this.id).execCommand('fontfamily', _this.fontfamily) } @@ -109,7 +109,7 @@ export default { }) }, beforeDestroy () { - UE.getEditor(this.id).body.removeEventListener('blur', this.editorBlur) + this.$refs.editorBoxRef.querySelector('.edui-for-formatmatch').removeEventListener('blur', this.editorBlur) }, destoryed () { this.editor.destory()