feat: add deleteNode method to node views

This commit is contained in:
Philipp Kühn
2021-05-19 00:01:49 +02:00
parent 0f299d228e
commit fcee5f82c6
7 changed files with 24 additions and 0 deletions

View File

@@ -40,6 +40,10 @@ export const nodeViewProps = {
type: Function as PropType<NodeViewProps['updateAttributes']>,
required: true,
},
deleteNode: {
type: Function as PropType<NodeViewProps['deleteNode']>,
required: true,
},
}
export interface VueNodeViewRendererOptions {
@@ -64,6 +68,7 @@ class VueNodeView extends NodeView<(Vue | VueConstructor), Editor> {
extension: this.extension,
getPos: () => this.getPos(),
updateAttributes: (attributes = {}) => this.updateAttributes(attributes),
deleteNode: () => this.deleteNode(),
}
const onDragStart = this.onDragStart.bind(this)