feat: update radio

pull/1845/head
tangjinzhou 2020-02-22 20:06:49 +08:00
parent f7ad7defe5
commit 601f9c159b
4 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
module.exports = {
dev: {
componentName: 'progress', // dev components
componentName: 'radio', // dev components
},
};

View File

@ -104,7 +104,7 @@ export default {
if (typeof option === 'string') {
return (
<Radio
key={index}
key={option}
prefixCls={prefixCls}
disabled={props.disabled}
value={option}
@ -116,7 +116,7 @@ export default {
} else {
return (
<Radio
key={index}
key={`radio-group-value-options-${option.value}`}
prefixCls={prefixCls}
disabled={option.disabled || props.disabled}
value={option.value}

View File

@ -28,17 +28,17 @@ export default {
configProvider: { default: () => ConfigConsumerProps },
},
methods: {
handleChange(event) {
const targetChecked = event.target.checked;
this.$emit('input', targetChecked);
this.$emit('change', event);
},
focus() {
this.$refs.vcCheckbox.focus();
},
blur() {
this.$refs.vcCheckbox.blur();
},
handleChange(event) {
const targetChecked = event.target.checked;
this.$emit('input', targetChecked);
this.$emit('change', event);
},
onChange(e) {
this.$emit('change', e);
if (this.radioGroupContext && this.radioGroupContext.onRadioChange) {

View File

@ -1,11 +1,11 @@
<cn>
#### 单选组合 - 配合 name 使用
可以为 RadioGroup 配置 `name` 参数,为组合内的 input 元素赋予相同的 `name` 属性,使浏览器把 RadioGroup 下的 Radio 真正看作是一组(例如可以通过方向键始终**在同一组内**更改选项)。
可以为 Radio.Group 配置 `name` 参数,为组合内的 input 元素赋予相同的 `name` 属性,使浏览器把 Radio.Group 下的 Radio 真正看作是一组(例如可以通过方向键始终**在同一组内**更改选项)。
</cn>
<us>
#### RadioGroup with name
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.
#### Radio.Group with name
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.
</us>
```tpl