Skip to content

Commit 1da6c34

Browse files
docs: ✏️ 修复RadioBox文档中关于表单模式表述错误的问题
1 parent 1d05654 commit 1da6c34

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

docs/component/radio.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ function change(e) {
6262

6363
## 表单模式
6464

65-
设置 `cell` 属性,开启表单模式复选框组
65+
设置 `cell` 属性,开启表单模式单选框组
6666

67-
开启表单模式时,如果同时设置 `shape``button` 开启表单复选按钮组模式
67+
开启表单模式时,如果同时设置 `shape``button` 开启表单模式单选按钮组模式
6868

6969
```html
70-
<wd-radio-group modelValue="1" cell>
70+
<wd-radio-group v-model="value" cell>
7171
<wd-radio value="1">选项一</wd-radio>
7272
<wd-radio value="2">选项二</wd-radio>
7373
<wd-radio value="3">选项三</wd-radio>
@@ -78,45 +78,58 @@ function change(e) {
7878
</wd-radio-group>
7979
```
8080

81+
``` ts
82+
const value = ref<number>(1)
83+
```
84+
8185
## 同行展示
8286

8387
设置 `inline` 属性,使单选框在同一行展示。
8488

8589
```html
86-
<wd-radio-group modelValue="1" inline>
90+
<wd-radio-group v-model="value" inline>
8791
<wd-radio value="1">单选框1</wd-radio>
8892
<wd-radio value="2">单选框2</wd-radio>
8993
</wd-radio-group>
9094
```
95+
``` ts
96+
const value = ref<number>(1)
97+
```
9198

9299
## 修改选中的颜色
93100

94101
设置 `checked-color` 属性。
95102

96103
```html
97-
<wd-radio-group modelValue="1" checked-color="#fa4350">
104+
<wd-radio-group v-model="value" checked-color="#fa4350">
98105
<wd-radio value="1">沃特</wd-radio>
99106
<wd-radio value="2">商家后台</wd-radio>
100107
</wd-radio-group>
101108
```
109+
``` ts
110+
const value = ref<number>(1)
111+
```
102112

103113
## 禁用
104114

105115
可以在 `radio-group` 上面设置 `disabled`,禁用所有单选框,也可以在单个单选框上面设置 `disabled` 属性,禁用某个单选框。
106116

107117
```html
108-
<wd-radio-group modelValue="1" disabled>
118+
<wd-radio-group v-model="value" disabled>
109119
<wd-radio value="1">沃特</wd-radio>
110120
<wd-radio value="2">商家后台</wd-radio>
111121
</wd-radio-group>
112122
```
123+
``` ts
124+
const value = ref<number>(1)
125+
```
113126

114127
## 尺寸
115128

116129
设置 `size` 属性,可选 `large`
117130

118131
```html
119-
<wd-radio-group modelValue="1" size="large">
132+
<wd-radio-group v-model="value" size="large">
120133
<wd-radio value="1">沃特</wd-radio>
121134
<wd-radio value="2">商家后台</wd-radio>
122135
</wd-radio-group>
@@ -127,7 +140,7 @@ function change(e) {
127140
radio设置的props优先级比radioGroup上设置的props优先级更高
128141

129142
```html
130-
<wd-radio-group modelValue="1" shape="button" disabled checked-color="#f00">
143+
<wd-radio-group v-model="value" shape="button" disabled checked-color="#f00">
131144
<wd-radio value="1" :disabled="false" checked-color="#000">商家后台</wd-radio>
132145
<wd-radio value="2" :disabled="false">沃特</wd-radio>
133146
<wd-radio value="3">商家智能</wd-radio>

0 commit comments

Comments
 (0)