mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fixes vue 3 custom node views when using class components (#5410)
This commit is contained in:
parent
535dcccb40
commit
be63e59050
5
.changeset/three-snakes-wink.md
Normal file
5
.changeset/three-snakes-wink.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/vue-3": patch
|
||||
---
|
||||
|
||||
fix vue3 class components not working as node views
|
@ -221,7 +221,12 @@ export function VueNodeViewRenderer(
|
||||
if (!(props.editor as Editor).contentComponent) {
|
||||
return {}
|
||||
}
|
||||
// check for class-component and normalize if neccessary
|
||||
const normalizedComponent = typeof component === 'function' && '__vccOpts' in component
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
? component.__vccOpts as Component
|
||||
: component
|
||||
|
||||
return new VueNodeView(component, props, options) as unknown as ProseMirrorNodeView
|
||||
return new VueNodeView(normalizedComponent, props, options) as unknown as ProseMirrorNodeView
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user