ueditor销毁后监听事件还在?

ueditor 有个工具栏跟随浏览器滚动的功能,在销毁时事件监听好像没有消掉
vue 先进入带 ueditor 的页面,然后通过 vue-router 跳转其他页面,滚动鼠标滚轮后报错

mounted () {
    this.editor = UE.getEditor('hneditor', this.config)
    this.editor.ready(() => {
        this.editor.setContent(this.value)
        this.editor.addListener("contentChange",() => {
            const wordCount = this.editor.getContentLength(true)
            const content = this.editor.getContent()
            const plainTxt = this.editor.getPlainTxt()
            this.$emit('change', { wordCount: wordCount, content: content, plainTxt: plainTxt })
        })
        // this.$emit('ready', this.editor)
    })
},
beforeDestroy () {
    this.editor.destroy()
    this.editor = {}
    // 这里已经调用了销毁方法
},

但是当vue页面跳转后会报出错误

clipboard.png
好像是监听事件还存在?

阅读 4.8k
1 个回答

clipboard.png
这个加一下就不报错了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题