You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/self-reference-tree/main.svelte

15 lines
263 B

<script>
export let file;
</script>
<article class='file {file.type}'>
<span class='name'>{file.name}</span>
{#if file.type === 'folder'}
<ul>
{#each file.children as child}
<li><svelte:self file='{child}'/></li>
{/each}
</ul>
{/if}
</article>