refactoring

This commit is contained in:
Philipp Kühn
2020-04-24 12:23:29 +02:00
parent f327be30bc
commit 3cca79b960

View File

@@ -3,27 +3,30 @@ import Vue from 'vue'
export default class ComponentView { export default class ComponentView {
// @ts-ignore // @ts-ignore
constructor(component, options) { constructor(component, options) {
// @ts-ignore this.mount(component)
this.component = component
// @ts-ignore
this.dom = this.createDOM()
// @ts-ignore
this.contentDOM = this.vm.$refs.content
} }
createDOM() { // @ts-ignore
mount(component) {
// @ts-ignore // @ts-ignore
const Component = Vue.extend(this.component) const Component = Vue.extend(component)
// @ts-ignore // @ts-ignore
this.vm = new Component({ this.vm = new Component({
// parent: this.parent, // parent: this.parent,
// propsData: props, // propsData: props,
}).$mount() }).$mount()
}
get dom() {
// @ts-ignore // @ts-ignore
return this.vm.$el return this.vm.$el
} }
get contentDOM() {
// @ts-ignore
return this.vm.$refs.content
}
} }