mirror of https://github.com/sveltejs/svelte
Merge pull request #1309 from sveltejs/gh-1306
ensure correct order of DOM insertions with neighbouring keyed each blockspull/1311/head
commit
58dba848c7
@ -0,0 +1,22 @@
|
||||
export default {
|
||||
data: {
|
||||
ones: [{ text: '1' }],
|
||||
twos: [{ text: '2' }],
|
||||
},
|
||||
|
||||
html: `
|
||||
<div>1</div>
|
||||
<div>2</div>
|
||||
`,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({
|
||||
ones: [{ text: '11' }]
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div>11</div>
|
||||
<div>2</div>
|
||||
`);
|
||||
},
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
{{#each ones as one @text}}
|
||||
<div>{{one.text}}</div>
|
||||
{{/each}}
|
||||
|
||||
{{#each twos as two @text}}
|
||||
<div>{{two.text}}</div>
|
||||
{{/each}}
|
Loading…
Reference in new issue