set parent component for vue node views

This commit is contained in:
Philipp Kühn
2020-12-14 12:05:46 +01:00
parent 8e7659bcd1
commit aef4bd88fc
4 changed files with 46 additions and 9 deletions

View File

@@ -252,9 +252,7 @@ export class Editor extends EventEmitter {
this.view.updateState(newState)
this.view.setProps({
nodeViews: this.extensionManager.nodeViews,
})
this.createNodeViews()
// Lets store the editor instance in the DOM element.
// So well have access to it for tests.
@@ -262,6 +260,15 @@ export class Editor extends EventEmitter {
dom.editor = this.proxy
}
/**
* Creates all node views.
*/
public createNodeViews() {
this.view.setProps({
nodeViews: this.extensionManager.nodeViews,
})
}
/**
* Creates a ProseMirror document.
*/