mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(radio-button-group): strongly type dispatched change/select events (#1819)
This commit is contained in:
parent
836b360b9b
commit
06d81ddbff
8 changed files with 42 additions and 18 deletions
|
@ -2,7 +2,13 @@
|
|||
import { RadioButton, RadioButtonSkeleton, RadioButtonGroup } from "../types";
|
||||
</script>
|
||||
|
||||
<RadioButtonGroup legendText="Storage tier (disk)" selected="standard">
|
||||
<RadioButtonGroup
|
||||
legendText="Storage tier (disk)"
|
||||
selected="standard"
|
||||
on:change="{(e) => {
|
||||
console.log(e.detail); // string
|
||||
}}"
|
||||
>
|
||||
<RadioButton labelText="Free (1 GB)" value="free" />
|
||||
<RadioButton labelText="Standard (10 GB)" value="standard" />
|
||||
<RadioButton labelText="Pro (128 GB)" value="pro" />
|
||||
|
|
|
@ -2,8 +2,16 @@
|
|||
import { TileGroup, RadioTile } from "../types";
|
||||
</script>
|
||||
|
||||
<TileGroup name="plan" required legend="Service pricing tiers">
|
||||
<RadioTile light value="0" checked>Lite plan</RadioTile>
|
||||
<TileGroup
|
||||
name="plan"
|
||||
required
|
||||
legend="Service pricing tiers"
|
||||
selected="0"
|
||||
on:select="{(e) => {
|
||||
console.log(e.detail); // string
|
||||
}}"
|
||||
>
|
||||
<RadioTile light checked value="0">Lite plan</RadioTile>
|
||||
<RadioTile value="1">Standard plan</RadioTile>
|
||||
<RadioTile value="2">Plus plan</RadioTile>
|
||||
</TileGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue