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

[FEAT] Expose default slot as prop #119

Open
cossssmin opened this issue May 28, 2024 · 0 comments
Open

[FEAT] Expose default slot as prop #119

cossssmin opened this issue May 28, 2024 · 0 comments

Comments

@cossssmin
Copy link
Member

cossssmin commented May 28, 2024

Would be useful to be able to get the content passed to a component as a prop, i.e.:

// button.html
<script props>
  module.exports = {
    yield: $slots.default // or props.yield maybe?
  }
</script>

<!--[if mso]>
  <a href="...">{{ yield }}</a>
<![endif]-->
<a href="..." style="mso-hide: all">
  <yield />
</a>

This way we could render the <yield /> tag in HTML comments where it doesn't render normally, through a prop.

Yes it can be passed like a prop but tbh this looks stupid to me, plus it's cumbersome to pass HTML as the label:

<x-button href="..." label="Hello World">
  Hello World
</x-button>
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

1 participant