mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-23 19:19:03 +08:00
fix lint error
This commit is contained in:
parent
4d77e8c4cc
commit
93a29c613c
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
**/dist/**
|
@ -14,9 +14,6 @@ module.exports = {
|
|||||||
'./**/*.js',
|
'./**/*.js',
|
||||||
'./**/*.vue',
|
'./**/*.vue',
|
||||||
],
|
],
|
||||||
excludedFiles: [
|
|
||||||
'dist/**',
|
|
||||||
],
|
|
||||||
plugins: [
|
plugins: [
|
||||||
'html',
|
'html',
|
||||||
'cypress',
|
'cypress',
|
||||||
|
@ -159,7 +159,7 @@ export class Editor extends EventEmitter {
|
|||||||
public setOptions(options: Partial<EditorOptions> = {}) {
|
public setOptions(options: Partial<EditorOptions> = {}) {
|
||||||
this.options = { ...this.options, ...options }
|
this.options = { ...this.options, ...options }
|
||||||
|
|
||||||
if (this.view && this.state) {
|
if (this.view && this.state && !this.isDestroyed) {
|
||||||
this.view.updateState(this.state)
|
this.view.updateState(this.state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,4 +399,12 @@ export class Editor extends EventEmitter {
|
|||||||
removeElement(this.css)
|
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() {
|
beforeDestroy() {
|
||||||
this.editor.options.element = this.$el
|
this.editor.setOptions({
|
||||||
|
element: this.$el,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user