-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Implement <svelte:fragment slot="name"> #4556
Conversation
79c6d32
to
6fd6790
Compare
Oooh, this looks exciting! Has there been previous discussion about it? I mean, is there somewhere we can read/learn more about this? |
6fd6790
to
03f0fd8
Compare
@rixo there's a rfc sveltejs/rfcs#18, but no one discussed about it. and it is useful for supporting #1037 |
Related to #1037 |
Just to reiterate the discussion on the RFC, there was a suggestion that we change |
It looks like the test failures here are just some parsing things, probably because |
c65a386
to
2d06e72
Compare
Oops, I took quite some time on this PR. I rewrote the PR, shifting bulk of the logic to That way, I can remove the |
@Conduitry probably can help review it again? thanks. |
2d06e72
to
2e565f1
Compare
83989dc
to
9b2cd4c
Compare
May I ask what is holding this back? |
Would love to see this implemented! Was just running into an issue today that this would solve nicely! 😌 |
When could we expect this to be implemented? |
I also had this problem <MyInput placeholder="请输入内容">
<MyButton slot="append" />
</MyInput>
// 'slot' is reserved for future use in named slots Hope to support |
👍 from me in support of this being merged in ASAP! |
Yes please. I would like to have this, too! |
add validation and test replace svelte:slot -> svelte:fragment slot as a sugar syntax fix eslint
9b2cd4c
to
cd99aab
Compare
🥳 Thanks! |
This is fantastic! Thank you so much one again @tanhauhau! However I'm a bit confused about the previous approach of using "forward slots" (#2079 ). Is the new I created a quick example and it seems the answer is yes. But it would be good to have a confirmation. Any advantages / disadvantages? https://svelte.dev/repl/1b2f3fe9bc934e20b72d8b403b860d59?version=3.35.0 Thanks. |
@paulovieira no.
thus, <!-- B.svelte -->
<C>
<slot name="xxx" slot="yyy" />
</C> will place the content within the so what is the content within that'll depend on the usage of Component B <!-- A.svelte -->
<B>
<div slot="xxx">this is the content for slot named xxx</div>
</B> Lastly, the content within Thus if you have <!-- B.svelte -->
<C>
<slot name="xxx" slot="yyy">fallback</slot>
</C>
<!-- A.svelte -->
<B />
<B>
<div slot="xxx">some content</div>
</B> you'll see lastly, a closed github issues isn't somewhere to ask question |
worked on top of the #4509 branch
as a sugar syntax for
Fixes #5626