add vue-2 and vue-3
This commit is contained in:
36
packages/vue-2/src/EditorContent.ts
Normal file
36
packages/vue-2/src/EditorContent.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
export default 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,
|
||||
})
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user