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

Riot v4 inserts elements which exists in pre-mounted element without <slot /> #2773

Closed
1 of 7 tasks
Qs-F opened this issue Oct 19, 2019 · 3 comments
Closed
1 of 7 tasks

Comments

@Qs-F
Copy link

Qs-F commented Oct 19, 2019

Help us to manage our issues by answering the following:

  1. Describe your issue:

With Riot v4, the elements which exists in a certain element is left after mounting that tag.

For example, if there is <my-tag><h1>hello</h1></my-tag> in index.html and my-tag is even defined without <slot /> tag internally, Riot injects the elements <h1>hello</h1> into the mounted tags.

I think this is a bug cuz with Riot v3 there is no such behavior.

  1. Can you reproduce the issue?

Yes.

Riot v4 example
Riot v3 behavior comparison

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

Chrome / Mac

  1. Which version of Riot does it affect?

4.6.5

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@Qs-F Qs-F changed the title Riot v4 inserts elements which exists in pre-mounted tag without <slot /> Riot v4 inserts elements which exists in pre-mounted element without <slot /> Oct 19, 2019
@Kal-Aster
Copy link

Hi,
reading the documentation here, it says in the note

Slots work only in compiled components, all the inner HTML of the components placed directly in your page DOM will be ignored.

@Qs-F
Copy link
Author

Qs-F commented Oct 20, 2019

Hi @EliteXXL ,

Thank you for your comment! I only read API docs, so didn't notice that.

Now I got it.

@Qs-F Qs-F closed this as completed Oct 20, 2019
@GianlucaGuarini
Copy link
Member

@Qs-F sorry this feature is no longer supported. I guess Vue.js supports it though but the library is also ~5 times bigger than Riot.js. I had to remove the runtime HTML parsing improving performance and maintainability of the core

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

3 participants