add editorcontent component
This commit is contained in:
32
packages/tiptap-core/src/components/EditorContent.ts
Normal file
32
packages/tiptap-core/src/components/EditorContent.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
export default Vue.extend({
|
||||
props: {
|
||||
editor: {
|
||||
default: null,
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
editor: {
|
||||
immediate: true,
|
||||
handler(editor) {
|
||||
if (editor && editor.element) {
|
||||
this.$nextTick(() => {
|
||||
this.$el.appendChild(editor.element.firstChild)
|
||||
// editor.setParentComponent(this)
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
render(createElement) {
|
||||
return createElement('div')
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.element = this.$el
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user