mirror of https://github.com/sveltejs/svelte
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.
23 lines
320 B
23 lines
320 B
4 years ago
|
<script>
|
||
|
const values = ['x', 'y', 'z'];
|
||
|
const list = {
|
||
|
a: [],
|
||
|
b: [],
|
||
|
c: [],
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
{#each Object.keys(list) as key}
|
||
|
{#each values as value}
|
||
|
<label>
|
||
|
<input
|
||
|
type='checkbox'
|
||
|
bind:group={list[key]}
|
||
|
value={value}
|
||
|
/>
|
||
|
{value}
|
||
|
</label>
|
||
|
{/each}
|
||
|
<p>{list[key].join(', ')}</p>
|
||
|
{/each}
|