forked from MapComplete/MapComplete
Refactoring: include 'label' section into Checkbox
This commit is contained in:
parent
08e408e19d
commit
4067912ce0
2 changed files with 25 additions and 25 deletions
|
@ -1,12 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { UIEventSource } from "../../Logic/UIEventSource.js"
|
||||
import type { Writable } from "svelte/store";
|
||||
|
||||
/**
|
||||
* For some stupid reason, it is very hard to bind inputs
|
||||
*/
|
||||
export let selected: UIEventSource<boolean>
|
||||
let _c: boolean = selected.data ?? true
|
||||
$: selected.setData(_c)
|
||||
export let selected: Writable<boolean>;
|
||||
let _c: boolean = selected.data ?? true;
|
||||
$: selected.set(_c);
|
||||
</script>
|
||||
|
||||
<input type="checkbox" bind:checked={_c} />
|
||||
<label class="no-image-background flex gap-1">
|
||||
<input bind:checked={_c} type="checkbox" />
|
||||
<slot />
|
||||
</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue