mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-17 04:17:52 +08:00
37 lines
626 B
TypeScript
37 lines
626 B
TypeScript
import Vue from 'vue'
|
|
|
|
export const EditorContent = Vue.extend({
|
|
name: 'EditorContent',
|
|
|
|
props: {
|
|
editor: {
|
|
default: null,
|
|
type: Object,
|
|
},
|
|
},
|
|
|
|
watch: {
|
|
editor: {
|
|
immediate: true,
|
|
handler(editor) {
|
|
if (editor && editor.options.element) {
|
|
this.$nextTick(() => {
|
|
this.$el.appendChild(editor.options.element.firstChild)
|
|
editor.createNodeViews()
|
|
})
|
|
}
|
|
},
|
|
},
|
|
},
|
|
|
|
render(createElement) {
|
|
return createElement('div')
|
|
},
|
|
|
|
beforeDestroy() {
|
|
this.editor.setOptions({
|
|
element: this.$el,
|
|
})
|
|
},
|
|
})
|