refactoring
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user