Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using named slots in markdown files #134

Open
marguerrrite opened this issue Mar 17, 2023 · 3 comments
Open

Using named slots in markdown files #134

marguerrrite opened this issue Mar 17, 2023 · 3 comments

Comments

@marguerrrite
Copy link

To get component slots to render correctly, this issue references putting a full return between brackets:

I found the solution for this, you need an extra line between them

# Title
Paragraph Text

<MyComponent>

Is it possible to **parse** markdown and pass it to a slot?

</MyComponent>

Is there a trick in getting named slots to work? To do something like the following:

<MyComponent>

    <template #header>
        My title
    </template>
    <template #card>
        My other slot
    </template>

</MyComponent>

As soon as I introduce the #, I get this parsing error (regardless of full returns):

[plugin:vite:vue] Element is missing end tag.
@DjilanoS
Copy link

MyComponent.vue

<div>
    <header>
        <slot name="header"/>
    </header>
  
    <div class="card">
        <slot name="card" />
    </div>
</div>

Inside the .MD file

<MyComponent>
    <template v-slot:header>My header</template>
    <template v-slot:card>My card</template>
</MyComponent>

Hope this helps @margueriteroth

@modelair
Copy link

i have same issue

@DjilanoS not works

@modelair
Copy link

@margueriteroth did u found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants