mirror of https://github.com/sveltejs/svelte
fix insert function (#6445)
parent
b662c7fd41
commit
201a71d8b7
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
props: {
|
||||
titles: [{ name: 'a' }, { name: 'b' }, { name: 'c' }]
|
||||
},
|
||||
|
||||
html: '<div class="container"><p>a</p><p>b</p><p>c</p></div>',
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.titles = [{ name: 'b' }, { name: 'c' }, { name: 'a' }];
|
||||
|
||||
assert.htmlEqual(target.innerHTML, '<div class="container"><p>b</p><p>c</p><p>a</p></div>');
|
||||
}
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
export let titles;
|
||||
</script>
|
||||
<div class="container">
|
||||
{#each titles as title (title.name)}
|
||||
<p>{title.name}</p>
|
||||
{/each}
|
||||
</div>
|
Loading…
Reference in new issue