Merge pull request #2028 from aphitiel/gh-1999

Failing test for #1999
pull/3358/head
Rich Harris 5 years ago committed by GitHub
commit 50f8c856c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,25 @@
export default {
props: {
tree: [
{id: 1, sub: null},
{id: 2, sub: [{id: 11}]}
]
},
html: `
<div>1</div>
<div>2\n<div>11</div></div>
`,
test({ assert, component, target }) {
component.tree = [
{id: 1, sub: null},
{id: 2, sub: null}
];
assert.htmlEqual(target.innerHTML, `
<div>1</div>
<div>2</div>
`);
}
};

@ -0,0 +1,12 @@
<script>
export let tree;
</script>
{#each tree as item, i (item.id)}
<div>
{item.id}
{#if item.sub}
<svelte:self tree={item.sub}/>
{/if}
</div>
{/each}
Loading…
Cancel
Save