refactoring

This commit is contained in:
Philipp Kühn
2018-09-11 09:18:38 +02:00
parent 2f1edbd8c3
commit 111b9cab2e

View File

@@ -16,12 +16,12 @@ export default class ComponentView {
this.editable = editable this.editable = editable
this.dom = this.createDOM() this.dom = this.createDOM()
this.contentDOM = this._vm.$refs.content this.contentDOM = this.vm.$refs.content
} }
createDOM() { createDOM() {
const Component = Vue.extend(this.component) const Component = Vue.extend(this.component)
this._vm = new Component({ this.vm = new Component({
propsData: { propsData: {
node: this.node, node: this.node,
view: this.view, view: this.view,
@@ -32,7 +32,7 @@ export default class ComponentView {
updateContent: content => this.updateContent(content), updateContent: content => this.updateContent(content),
}, },
}).$mount() }).$mount()
return this._vm.$el return this.vm.$el
} }
updateAttrs(attrs) { updateAttrs(attrs) {
@@ -75,12 +75,12 @@ export default class ComponentView {
this.node = node this.node = node
this.decorations = decorations this.decorations = decorations
this._vm._props.node = node this.vm._props.node = node
this._vm._props.decorations = decorations this.vm._props.decorations = decorations
return true return true
} }
destroy() { destroy() {
this._vm.$destroy() this.vm.$destroy()
} }
} }