# Radio Radio button, used for selecting a single option from a set of alternatives. ## Basic Usage `v-model` is the binding value, which is the `value` of the selected `wd-radio`. ```html Radio 1 Radio 2 Current selected value: {{value}} ``` ```typescript const value = ref(1) ``` ## Modify Icon Shape Modify the `shape` property, available values are 'dot', 'button', 'check', default is 'check'. ```html WOT Merchant Backend ``` ```typescript const value = ref(1) function change(e) { console.log(e) } ``` >
Note:
>
When content items are within 3 items and have important information to choose from (such as payment type selection), you can consider using the circular component. Because it can be easily confused with circular checkboxes and will cause inconsistency in the current form page structure, dot-style radio buttons are generally not recommended.
```html WOT Merchant Backend ``` ```typescript const value = ref(1) function change(e) { console.log(e) } ``` ## Form Mode Set the `cell` property to enable form mode radio group. When form mode is enabled, if `shape` is set to `button`, it will enable form mode radio button group mode. ```html Option 1 Option 2 Option 3 Option 4 Option 5 Option 6 Option 7 ``` ```typescript const value = ref(1) ``` ## Inline Display Set the `inline` property to display radio buttons in the same line. ```html Radio 1 Radio 2 ``` ```typescript const value = ref(1) ``` ## Modify Selected Color Set the `checked-color` property. ```html WOT Merchant Backend ``` ```typescript const value = ref(1) ``` ## Disabled You can set the `disabled` property on `radio-group` to disable all radio buttons, or set the `disabled` property on individual radio buttons to disable specific ones. ```html WOT Merchant Backend ``` ```typescript const value = ref(1) ``` ## Size Set the `size` property, available value is `large`. ```html WOT Merchant Backend ``` ## Props Priority Props set on radio have higher priority than props set on radioGroup ```html Merchant Backend WOT Merchant Intelligence ``` ## RadioGroup Attributes | Parameter | Description | Type | Options | Default | Version | |-----------|-------------|------|----------|---------|----------| | v-model | Will automatically select the radio with matching value | string / number / boolean | - | - | - | | shape | Radio button shape | string | dot / button / check | check | - | | size | Set size | string | large | - | - | | checked-color | Selected color | string | - | #4D80F0 | - | | disabled | Disabled | boolean | - | false | - | | max-width | Maximum width of text position | string | - | - | - | | inline | Display in same line | boolean | - | false | - | | cell | Form mode | boolean | - | false | - | | icon-placement | Check icon alignment | string | left / right / auto | auto | 1.5.0 | ## RadioGroup Events | Event Name | Description | Parameters | Version | |------------|-------------|------------|----------| | change | Triggered when binding value changes | `{ value }` | - | ## Radio Attributes | Parameter | Description | Type | Options | Default | Version | |-----------|-------------|------|----------|---------|----------| | value | Value when radio is selected. Will automatically match radioGroup's value | string / number / boolean | - | - | - | | shape | Radio button shape | string | dot / button / check | check | - | | checked-color | Selected color | string | - | #4D80F0 | - | | disabled | Disabled | boolean | - | false | - |