You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/each-block-scope-shadow-bind-4/main.svelte

14 lines
233 B

<script>
let a = [
{ a: { b: 'Hello', c: 'World' }, key: 'b' },
];
</script>
{#each a as { a, key }}
<div>
{key}: {a[key]}
<input bind:value={a[key]}>
</div>
{/each}
<button on:click={() => a[0].key = 'c'}>Button</button>