fix lint error
This commit is contained in:
@@ -159,7 +159,7 @@ export class Editor extends EventEmitter {
|
||||
public setOptions(options: Partial<EditorOptions> = {}) {
|
||||
this.options = { ...this.options, ...options }
|
||||
|
||||
if (this.view && this.state) {
|
||||
if (this.view && this.state && !this.isDestroyed) {
|
||||
this.view.updateState(this.state)
|
||||
}
|
||||
}
|
||||
@@ -399,4 +399,12 @@ export class Editor extends EventEmitter {
|
||||
removeElement(this.css)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the editor is already destroyed.
|
||||
*/
|
||||
private get isDestroyed() {
|
||||
// @ts-ignore
|
||||
return !this.view?.docView
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.options.element = this.$el
|
||||
this.editor.setOptions({
|
||||
element: this.$el,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user