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/nested-transition-detach-if.../Folder.svelte

36 lines
477 B

<script>
export let dir;
export let open = true;
function get_items() {
return dir === 'a'
? [
{
filename: 'a/b',
isDir: true
}
]
: [
{
filename: 'a/b/c',
isDir: false
}
];
}
</script>
<li>
<span>{dir}</span>
{#if open}
<ul>
{#each get_items() as item (item.filename)}
{#if item.isDir}
<svelte:self dir={item.filename}/>
{:else}
<li>{item.filename}</li>
{/if}
{/each}
</ul>
{/if}
</li>