(1)
function change(e) {
console.log(e)
}
```
> 注意:
> 内容项在3项以内,且有比较重要的信息备选(如付款类型选择等)可考虑采用圆形组件。因为会跟圆形复选框容易混淆,且会造成当前表单页页面结构不统一,一般情况不建议使用点状单选。
```html
沃特
商家后台
```
```typescript
const value = ref(1)
function change(e) {
console.log(e)
}
```
## 表单模式
设置 `cell` 属性,开启表单模式单选框组。
开启表单模式时,如果同时设置 `shape` 为 `button` 开启表单模式单选按钮组模式。
```html
选项一
选项二
选项三
选项四
选项五
选项六
选项七
```
``` ts
const value = ref(1)
```
## 同行展示
设置 `inline` 属性,使单选框在同一行展示。
```html
单选框1
单选框2
```
``` ts
const value = ref(1)
```
## 修改选中的颜色
设置 `checked-color` 属性。
```html
沃特
商家后台
```
``` ts
const value = ref(1)
```
## 禁用
可以在 `radio-group` 上面设置 `disabled`,禁用所有单选框,也可以在单个单选框上面设置 `disabled` 属性,禁用某个单选框。
```html
沃特
商家后台
```
``` ts
const value = ref(1)
```
## 尺寸
设置 `size` 属性,可选 `large`。
```html
沃特
商家后台
```
## Props优先级
radio设置的props优先级比radioGroup上设置的props优先级更高
```html
商家后台
沃特
商家智能
```
## RadioGroup Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
| -------------- | --------------------------- | ------------------------- | -------------------- | ------- | ---------------- |
| v-model | 会自动选中value对应的单选框 | string / number / boolean | - | - | - |
| shape | 单选框形状 | string | dot / button / check | check | - |
| size | 设置大小 | string | large | - | - |
| checked-color | 选中的颜色 | string | - | #4D80F0 | - |
| disabled | 禁用 | boolean | - | false | - |
| max-width | 文字位置最大宽度 | string | - | - | - |
| inline | 同行展示 | boolean | - | false | - |
| cell | 表单模式 | boolean | - | false | - |
| icon-placement | 勾选图标对齐方式 | string | left / right/ auto | auto | 1.5.0 |
## RadioGroup Events
| 事件名称 | 说明 | 参数 | 最低版本 |
| -------- | ---------------- | ----------- | -------- |
| change | 绑定值变化时触发 | `{ value }` | - |
## Radio Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
| ------------- | --------------------------------------------- | ------------------------- | -------------------- | ------- | -------- |
| value | 单选框选中时的值。会自动匹配radioGroup的value | string / number / boolean | - | - | - |
| shape | 单选框形状 | string | dot / button / check | check | - |
| checked-color | 选中的颜色 | string | - | #4D80F0 | - |
| disabled | 禁用 | boolean | - | false | - |