mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +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
|
@ -9245,6 +9245,11 @@
|
|||
],
|
||||
"slots": [],
|
||||
"events": [
|
||||
{
|
||||
"type": "dispatched",
|
||||
"name": "toggle",
|
||||
"detail": "{ toggled: boolean; }"
|
||||
},
|
||||
{ "type": "forwarded", "name": "click", "element": "div" },
|
||||
{ "type": "forwarded", "name": "mouseover", "element": "div" },
|
||||
{ "type": "forwarded", "name": "mouseenter", "element": "div" },
|
||||
|
|
|
@ -19,6 +19,10 @@ components: ["Toggle", "ToggleSkeleton"]
|
|||
|
||||
<FileSource src="/framed/Toggle/ToggleReactive" />
|
||||
|
||||
### on:toggle event
|
||||
|
||||
<Toggle labelText="Push notifications" on:toggle={e => console.log(e.detail)} />
|
||||
|
||||
### Custom labels
|
||||
|
||||
<Toggle labelText="Push notifications" labelA="No" labelB="Yes" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue