Tiptap: Custom vue components slots

Created on 17 Jan 2019  路  7Comments  路  Source: ueberdosis/tiptap

Hello,
Does tiptape support custom vue components with slots? And can you please provide an example if yes.

question

Most helpful comment

I'm still not sure what you want to do. You can define inner content for nested nodes with ref="content". ProseMirror will render any child nodes into this element. Is that what you want to achieve?

<div class="my-custom-component">
   <div ref="content"></div>
<div/>

All 7 comments

What do you mean with slots here? What do you want to achieve?

Sorry for late reply. I want to make a spoiler as vue component and I want to pass spoiler content into slot of this component.

I believe what is being asked is whether custom Vue components can provide a slot in order to accept inner content. I too would like an answer to that question.

I'm still not sure what you want to do. You can define inner content for nested nodes with ref="content". ProseMirror will render any child nodes into this element. Is that what you want to achieve?

<div class="my-custom-component">
   <div ref="content"></div>
<div/>

This is precisely what I was looking for, thank you. I highly recommend noting this somewhere in the documentation; this feature cleanly enables some really bespoke editing capabilities.

Yeah. Docs are incomplete but I'm working on a new documentation page.

I'm still not sure what you want to do. You can define inner content for nested nodes with ref="content". ProseMirror will render any child nodes into this element. Is that what you want to achieve?

<div class="my-custom-component">
   <div ref="content"></div>
<div/>

This should definitely be part of the docs !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

santicros picture santicros  路  3Comments

jetacpp picture jetacpp  路  3Comments

agentq15 picture agentq15  路  3Comments

nekooee picture nekooee  路  3Comments

pk-pressf1 picture pk-pressf1  路  3Comments