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

Can't use template for slot #2888

Closed
1 of 7 tasks
Kal-Aster opened this issue Nov 23, 2020 · 3 comments
Closed
1 of 7 tasks

Can't use template for slot #2888

Kal-Aster opened this issue Nov 23, 2020 · 3 comments

Comments

@Kal-Aster
Copy link

Kal-Aster commented Nov 23, 2020

Help us to manage our issues by answering the following:

  1. Describe your issue:

When using template tag for pass multiple children to a slot, riot crashes but only if inside the template tag there is a binding, if it is pure html it won't crash...

  1. Can you reproduce the issue?

here

  1. On which browser/OS does the issue appear?

any, I think. I'm on Firefox@latest

  1. Which version of Riot does it affect?

v5

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@GianlucaGuarini
Copy link
Member

I had the same issue once and then I used <span> tags. I will look into it. Thank you for your feedback

@Kal-Aster
Copy link
Author

Yeah, I used div to make it work, but I think it would be great if it work also with template.

Thank you ^^

@GianlucaGuarini
Copy link
Member

GianlucaGuarini commented Nov 28, 2020

This feature was added in Riot.js@5.1.0.
Notice that if you are using unamed slots on your <template> tags, you will need to eplicitely set the name="default" attribute on them for example:

<my-tag>
  <child>
     <template slot="default">{'hello there'}</template>
  </child>
</my-tag>

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

No branches or pull requests

2 participants