mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 20:09:35 +00:00
feat(toggle): dispatch toggle event
This commit is contained in:
parent
fed83f8bf4
commit
c0dd80d149
6 changed files with 38 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue