You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing documentation for a component library. Some components have slots.
When it's a default slot, I fill it by simply placing content in <Component> </Component>, it works perfectly, and the slotted content renders in the markdown page.
When it's a named slot, I have to wrap it in <template #nameoftheslot> </template> as per Vue slot system, and my content is not rendered. When reading Vitepress documentation, I read that <template> is not to be used in the Markdown page, and though I understand the redundance with Vue SFC templates, we need to be able to used named slots to make these kind of component work...
Did I miss something or am I trying to do this the wrong way ?
If not, it would be greatly appreciated to implement named slots in the Markdown pages.
Reproduction
Use a Vue component in your Markdown page
This component should have a named slot (eg: <slot name="header"> </slot>)
Try to pass content to that slot (eg: <template #header> i'm slotted </template>)
=> "i"m slotted" won't be rendered
Expected behavior
Named slots should be parsed and rendered correctly, we should see slotted content passed in a named slot
But yeah if I use a classic import it works, and it also works with the <ClientOnly> component wrapping my custom component! I don't remember why I used the other syntax, maybe I tested sth and I actually don't need it anymore...
Describe the bug
I'm writing documentation for a component library. Some components have slots.
<Component> </Component>
, it works perfectly, and the slotted content renders in the markdown page.<template #nameoftheslot> </template>
as per Vue slot system, and my content is not rendered. When reading Vitepress documentation, I read that<template>
is not to be used in the Markdown page, and though I understand the redundance with Vue SFC templates, we need to be able to used named slots to make these kind of component work...Did I miss something or am I trying to do this the wrong way ?
If not, it would be greatly appreciated to implement named slots in the Markdown pages.
Reproduction
<slot name="header"> </slot>
)<template #header> i'm slotted </template>
)=> "i"m slotted" won't be rendered
Expected behavior
Named slots should be parsed and rendered correctly, we should see slotted content passed in a named slot
System Info
Additional context
My carousel has no slide rendered
Validations
The text was updated successfully, but these errors were encountered: