mirror of https://github.com/sveltejs/svelte
only apply key to keyed each block, not its children - fixes #1202
parent
355490878d
commit
7b4c486be9
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
data: {
|
||||
items: [
|
||||
{ id: 1, name: 'one' },
|
||||
{ id: 2, name: 'two' }
|
||||
]
|
||||
},
|
||||
|
||||
html: `
|
||||
<ul>
|
||||
<li>one</li>
|
||||
<li>two</li>
|
||||
</ul>
|
||||
`
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<ul>
|
||||
{{#each items as item @id}}
|
||||
{{#if item.id}}
|
||||
<li>{{item.name}}</li>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
Loading…
Reference in new issue