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.
25 lines
443 B
25 lines
443 B
4 years ago
|
<script>
|
||
|
const options = [1, 2, 3];
|
||
|
export let selected_array = [
|
||
|
[[1], [1, 2, 3]],
|
||
|
[[2], [1]],
|
||
|
];
|
||
|
export let selected_index = [0, 1];
|
||
|
</script>
|
||
|
|
||
|
{#each selected_array as selected}
|
||
|
{#each selected_index as index}
|
||
|
{#each options as value}
|
||
|
<label>
|
||
|
<input
|
||
|
type='checkbox'
|
||
|
bind:group={selected[index]}
|
||
|
value={value}
|
||
|
/>
|
||
|
{value}
|
||
|
</label>
|
||
|
{/each}
|
||
|
<p>{selected[index].join(', ')}</p>
|
||
|
{/each}
|
||
|
{/each}
|