refactoring
This commit is contained in:
@@ -39,7 +39,6 @@ export default class Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.bus = new Vue()
|
|
||||||
this.element = document.createElement('div')
|
this.element = document.createElement('div')
|
||||||
this.extensions = this.createExtensions()
|
this.extensions = this.createExtensions()
|
||||||
this.nodes = this.createNodes()
|
this.nodes = this.createNodes()
|
||||||
@@ -261,14 +260,6 @@ export default class Editor {
|
|||||||
this.view.focus()
|
this.view.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
emit(event, ...data) {
|
|
||||||
this.bus.$emit(event, ...data)
|
|
||||||
}
|
|
||||||
|
|
||||||
on(event, callback) {
|
|
||||||
this.bus.$on(event, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
registerPlugin(plugin = null) {
|
registerPlugin(plugin = null) {
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
this.state = this.state.reconfigure({
|
this.state = this.state.reconfigure({
|
||||||
@@ -296,8 +287,6 @@ export default class Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.emit('destroy')
|
|
||||||
|
|
||||||
if (this.view) {
|
if (this.view) {
|
||||||
this.view.destroy()
|
this.view.destroy()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user