Closed gorlanova closed 1 month ago
Seems to work fine - https://stackblitz.com/edit/vite-th6x3s?file=docs/index.md,docs/Foo.vue
Can you share a minimal reproducible example?
Oh my, I was using this:
import { defineClientComponent } from 'vitepress'
const Foo = defineClientComponent(() => {
return import('./Foo.vue');
})
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...
Though the problem remains: if someone needs to use that syntax AND named slots, it won't work. Demo: https://stackblitz.com/edit/vite-mn3qjy?file=docs%2Findex.md
But for what I need to do for now, it's all good :)
Duplicate of #3867
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