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

Scoped slots #69

Open
ManUtopiK opened this issue Nov 17, 2023 · 3 comments
Open

Scoped slots #69

ManUtopiK opened this issue Nov 17, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ManUtopiK
Copy link
Contributor

Is your feature request related to a problem? Please describe.

How to handle scoped slots with MDC syntax ? And how to pass slot props to child components ?

Describe the solution you'd like to see

From this template :

<!-- <MyComponent> template -->
<div>
  <slot :text="greetingMessage" :count="1"></slot>
</div>

To this :

::my-component
#default{text count}
This is a {{ text }} and a {{ count }}
This is an inline :child-component{text=":text" count=":count"}
::

🤔 I'm not convinced.
We should take care about the v-bind shorthand : with the frontmatter. doc

What do you think about ?

@ManUtopiK ManUtopiK added the enhancement New feature or request label Nov 17, 2023
Copy link
Member

atinux commented Nov 22, 2023

What is the main use case for this? I am afraid we might go too far by supporting scoped slots

@ManUtopiK
Copy link
Contributor Author

I am afraid we might go too far by supporting scoped slots

I understand well. For now, I duplicate components or use composable as a workaround.
But I think the more I go with mdc, the more I'll need this feature.
If you want, you can close this issue for now...

@adamdehaven
Copy link

What is the main use case for this? I am afraid we might go too far by supporting scoped slots

@atinux I've outlined a decent use case here nuxt-modules/mdc#43 (comment) involving looping through front matter arrays for nested components

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

No branches or pull requests

3 participants