mirror of https://github.com/sveltejs/svelte
parent
ea0d80e195
commit
53af138d58
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: read index as a source in legacy keyed each block
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
export let item;
|
||||
console.log(item);
|
||||
item = 1;
|
||||
</script>
|
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, target, logs }) {
|
||||
const p = target.querySelector('p');
|
||||
assert.equal(p?.innerHTML, '1');
|
||||
assert.deepEqual(logs, [0]);
|
||||
}
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
const items = [0];
|
||||
</script>
|
||||
|
||||
{#each items as item, idx(item)}
|
||||
<Component bind:item />
|
||||
{/each}
|
||||
|
||||
<p>{items}</p>
|
Loading…
Reference in new issue