feat(toggle): dispatch toggle event

This commit is contained in:
Eric Liu 2021-02-03 06:04:07 -08:00
commit c0dd80d149
6 changed files with 38 additions and 11 deletions

View file

@ -1,4 +1,8 @@
<script>
/**
* @event {{ toggled: boolean; }} toggle
*/
/**
* Specify the toggle size
* @type {"default" | "sm"}
@ -28,6 +32,12 @@
* @type {string}
*/
export let name = undefined;
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
$: dispatch("toggle", { toggled });
</script>
<div