mirror of https://github.com/sveltejs/svelte
append to the dom, not a document fragment, when updating each block in slot - fixes #927
parent
0a01aa0243
commit
d32328ca69
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<slot/>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
export default {
|
||||
data: {
|
||||
things: [1, 2, 3]
|
||||
},
|
||||
|
||||
html: `
|
||||
<div>
|
||||
<span>1</span>
|
||||
<span>2</span>
|
||||
<span>3</span>
|
||||
</div>`,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({ things: [1, 2, 3, 4] });
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div>
|
||||
<span>1</span>
|
||||
<span>2</span>
|
||||
<span>3</span>
|
||||
<span>4</span>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
<Nested>
|
||||
{{#each things as thing}}
|
||||
<span>{{thing}}</span>
|
||||
{{/each}}
|
||||
</Nested>
|
||||
|
||||
<script>
|
||||
import Nested from './Nested.html';
|
||||
|
||||
export default {
|
||||
components: { Nested }
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue