fix: miniToggle call save on action

This commit is contained in:
Ben Allfree 2023-06-19 05:12:31 -07:00
parent 09e33458c2
commit 1f41a9fbf2

View File

@ -7,7 +7,7 @@
const id = uniqueId() const id = uniqueId()
let msg = '' let msg = ''
$: { const onChange = () => {
save(value) save(value)
.then((res) => { .then((res) => {
msg = res msg = res
@ -19,6 +19,13 @@
</script> </script>
<div class="form-check form-switch"> <div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" {id} bind:checked={value} /> <input
class="form-check-input"
type="checkbox"
role="switch"
{id}
bind:checked={value}
on:change={onChange}
/>
<label class="form-check-label" for={id}><slot /></label> <label class="form-check-label" for={id}><slot /></label>
</div> </div>