mirror of https://github.com/sveltejs/svelte
fix: apply correct snippet scope (#9623)
parent
509f92d29e
commit
d8d9be39d3
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure snippets have correct scope
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let { inner } = $props();
|
||||
</script>
|
||||
|
||||
{#if inner}
|
||||
{@render inner()}
|
||||
{/if}
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<p>S</p><a href="#">S</a><p>v</p><a href="#">v</a><p>e</p><a href="#">e</a><p>l</p><a href="#">l</a><p>t</p><a href="#">t</a><p>e</p><a href="#">e</a>`
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
let name = "Svelte";
|
||||
</script>
|
||||
|
||||
{#each name.split('') as character}
|
||||
<p>{character}</p>
|
||||
<Component>
|
||||
{#snippet inner()}
|
||||
<a href={'#'}>{character}</a>
|
||||
{/snippet}
|
||||
</Component>
|
||||
{/each}
|
Loading…
Reference in new issue