refactor: remove isEditable from node views, remove viewUpdate event
This commit is contained in:
@@ -8,8 +8,6 @@ export const NodeViewContent = defineComponent({
|
||||
},
|
||||
},
|
||||
|
||||
inject: ['isEditable'],
|
||||
|
||||
render() {
|
||||
return h(
|
||||
this.as, {
|
||||
@@ -17,8 +15,6 @@ export const NodeViewContent = defineComponent({
|
||||
whiteSpace: 'pre-wrap',
|
||||
},
|
||||
'data-node-view-content': '',
|
||||
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
||||
contenteditable: this.isEditable.value,
|
||||
},
|
||||
)
|
||||
},
|
||||
|
||||
@@ -71,11 +71,6 @@ class VueNodeView extends NodeView<Component, Editor> {
|
||||
}
|
||||
|
||||
const onDragStart = this.onDragStart.bind(this)
|
||||
const isEditable = ref(this.editor.isEditable)
|
||||
|
||||
this.editor.on('viewUpdate', () => {
|
||||
isEditable.value = this.editor.isEditable
|
||||
})
|
||||
|
||||
this.decorationClasses = ref(this.getDecorationClasses())
|
||||
|
||||
@@ -84,7 +79,6 @@ class VueNodeView extends NodeView<Component, Editor> {
|
||||
props: Object.keys(props),
|
||||
setup: () => {
|
||||
provide('onDragStart', onDragStart)
|
||||
provide('isEditable', isEditable)
|
||||
provide('decorationClasses', this.decorationClasses)
|
||||
|
||||
return (this.component as any).setup?.(props)
|
||||
|
||||
Reference in New Issue
Block a user