move componentrenderer
This commit is contained in:
33
packages/vue/src/Renderer.ts
Normal file
33
packages/vue/src/Renderer.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import Vue from 'vue'
|
||||
import { ComponentRenderer } from '@tiptap/core'
|
||||
|
||||
export default class Renderer extends ComponentRenderer {
|
||||
|
||||
static type: string = 'vue'
|
||||
|
||||
vm!: Vue
|
||||
|
||||
constructor(component: Vue, options: any) {
|
||||
super()
|
||||
this.mount(component)
|
||||
}
|
||||
|
||||
mount(component: Vue) {
|
||||
const Component = Vue.extend(component)
|
||||
|
||||
this.vm = new Component({
|
||||
// parent: this.parent,
|
||||
// propsData: props,
|
||||
}).$mount()
|
||||
}
|
||||
|
||||
get dom() {
|
||||
return this.vm.$el
|
||||
}
|
||||
|
||||
get contentDOM() {
|
||||
return this.vm.$refs.content
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user