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.html

44 lines
562 B

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