add NodeViewWrapper and NodeViewContent to vue-2

This commit is contained in:
Philipp Kühn
2021-03-05 10:18:44 +01:00
parent 27b55a2c53
commit 983b56a5f2
10 changed files with 127 additions and 80 deletions

View File

@@ -8,7 +8,7 @@ export const NodeViewContent = defineComponent({
},
},
inject: ['editable'],
inject: ['isEditable'],
render() {
return h(
@@ -18,7 +18,7 @@ export const NodeViewContent = defineComponent({
},
'data-node-view-content': '',
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
contenteditable: this.editable.value,
contenteditable: this.isEditable.value,
},
)
},

View File

@@ -86,7 +86,7 @@ class VueNodeView implements NodeView {
props: Object.keys(props),
setup() {
provide('onDragStart', onDragStart)
provide('editable', isEditable)
provide('isEditable', isEditable)
return (component as any).setup?.()
},