I'm having a little trouble with updating variables using nested files. My expectation is that when the checkmark is checked
, the variable switchTouch
is updated. I'm clearly doing something incorrectly as this isn't the case. Any pointers would be welcomed:
<script>
import Control from './Control.svelte'
let switchTouch = false
let switchScreen = true
let controls = [
{ id: 1, title: 'Touch Targets', checked: switchTouch },
{ id: 2, title: 'Screen Reader', checked: switchScreen }
];
$: console.log(switchTouch)
</script>
{#each controls as control}
<Control title={control.title} bind:value={control.checked} />
{/each}
The REPL I'm using for a more detailed example