Skip to content

Commit 601f9c1

Browse files
committed
feat: update radio
1 parent f7ad7de commit 601f9c1

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

build/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
dev: {
3-
componentName: 'progress', // dev components
3+
componentName: 'radio', // dev components
44
},
55
};

components/radio/Group.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
if (typeof option === 'string') {
105105
return (
106106
<Radio
107-
key={index}
107+
key={option}
108108
prefixCls={prefixCls}
109109
disabled={props.disabled}
110110
value={option}
@@ -116,7 +116,7 @@ export default {
116116
} else {
117117
return (
118118
<Radio
119-
key={index}
119+
key={`radio-group-value-options-${option.value}`}
120120
prefixCls={prefixCls}
121121
disabled={option.disabled || props.disabled}
122122
value={option.value}

components/radio/Radio.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ export default {
2828
configProvider: { default: () => ConfigConsumerProps },
2929
},
3030
methods: {
31-
handleChange(event) {
32-
const targetChecked = event.target.checked;
33-
this.$emit('input', targetChecked);
34-
this.$emit('change', event);
35-
},
3631
focus() {
3732
this.$refs.vcCheckbox.focus();
3833
},
3934
blur() {
4035
this.$refs.vcCheckbox.blur();
4136
},
37+
handleChange(event) {
38+
const targetChecked = event.target.checked;
39+
this.$emit('input', targetChecked);
40+
this.$emit('change', event);
41+
},
4242
onChange(e) {
4343
this.$emit('change', e);
4444
if (this.radioGroupContext && this.radioGroupContext.onRadioChange) {

components/radio/demo/radioGroup-with-name.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<cn>
22
#### 单选组合 - 配合 name 使用
3-
可以为 RadioGroup 配置 `name` 参数,为组合内的 input 元素赋予相同的 `name` 属性,使浏览器把 RadioGroup 下的 Radio 真正看作是一组(例如可以通过方向键始终**在同一组内**更改选项)。
3+
可以为 Radio.Group 配置 `name` 参数,为组合内的 input 元素赋予相同的 `name` 属性,使浏览器把 Radio.Group 下的 Radio 真正看作是一组(例如可以通过方向键始终**在同一组内**更改选项)。
44
</cn>
55

66
<us>
7-
#### RadioGroup with name
8-
Passing the `name` property to all `input[type="radio"]` that are in the same RadioGroup. It is usually used to let the browser see your RadioGroup as a real "group" and keep the default behavior. For example, using left/right keyboard arrow to change your selection that in the same RadioGroup.
7+
#### Radio.Group with name
8+
Passing the `name` property to all `input[type="radio"]` that are in the same Radio.Group. It is usually used to let the browser see your Radio.Group as a real "group" and keep the default behavior. For example, using left/right keyboard arrow to change your selection that in the same Radio.Group.
99
</us>
1010

1111
```tpl

0 commit comments

Comments
 (0)