mirror of https://github.com/sveltejs/svelte
fix: better children snippet / default slot interop (#13734)
- correctly assign children snippet to default slot, fixes #13067 - allow `svelte:fragment` without `let:` directives to be rendered by `@render children()`, fixes #13066pull/13738/head
parent
d0bfd22bef
commit
8251bae8db
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: better children snippet / default slot interop
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<p>bar</p>`
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
{@render children()}
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
import Child from './child.svelte';
|
||||
</script>
|
||||
|
||||
<Child>
|
||||
<svelte:fragment>
|
||||
<p>bar</p>
|
||||
</svelte:fragment>
|
||||
</Child>
|
@ -1,5 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<p>Default</p> <p>Named foo</p>`
|
||||
html: `<p>Default foo</p> <p>Named bar</p>`
|
||||
});
|
||||
|
@ -1,2 +1,2 @@
|
||||
<p><slot /></p>
|
||||
<p><slot name="named" foo="foo" /></p>
|
||||
<p><slot foo="foo" /></p>
|
||||
<p><slot name="named" bar="bar" /></p>
|
||||
|
Loading…
Reference in new issue