Ensure VueNodeViewRenderer will use Editor's Global Vue Instance #2604
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if you attempt to register a component via
Vue.component()
with a different global instance of Vue (this can happen if you are building plugins for an existing application and the plugin and application exist in separate bundles) the component will not be found via theVue
imported into VueNodeViewRenderer.In an ideal world, when attempting to
Vue.extend()
a component via the VueNodeViewRenderer.. (for example):then the provided
uiForNodeComponent
will beVue.extend()
ed by a Global Vue that has access to any previously registered (Vue.component(...)
) components. The only way to ensure this in a situation where there might be multiple Global views (multiple bundles with Vue), is to use the one that is inside the actual editor'scontentComponent
.There are probably a few more places where tiptap should favor the editor Vue, but this at least solves the problem of using the right Vue from within a Node creation, as per how the documentation describes building custom Vue backed components.
Without this particular fix, one would get the message below when attempting to use a Globally registered Vue component inside a Node's View.