From ddc3f83d768d9c935dc7f6d5eb60616b449beb8d Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Jul 2015 17:31:56 +0800 Subject: [PATCH] update radio --- components/form/demo/mix.md | 16 +++++++--------- components/radio/group.jsx | 6 ++++-- components/radio/index.jsx | 3 +-- style/components/radio.less | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/components/form/demo/mix.md b/components/form/demo/mix.md index bdb2c680c0..986c5cf4f1 100644 --- a/components/form/demo/mix.md +++ b/components/form/demo/mix.md @@ -17,6 +17,7 @@ var Dropdown = antd.Dropdown; var Slider = antd.Slider; var Checkbox = antd.Checkbox; var Radio = antd.Radio; +var RadioGroup = antd.RadioGroup; var menu = @@ -101,15 +102,12 @@ React.render(
- - - + + 选项一 + 选项二 + 选项三 + 选项四 +
diff --git a/components/radio/group.jsx b/components/radio/group.jsx index a75ff11727..aa143170be 100644 --- a/components/radio/group.jsx +++ b/components/radio/group.jsx @@ -26,7 +26,7 @@ var AntRadioGroup = React.createClass({ if (radio.props) { return ; } return radio; @@ -41,7 +41,9 @@ var AntRadioGroup = React.createClass({ this.setState({ selectedValue: ev.target.value }); - this.props.onChange(ev); + if (typeof this.props.onChange === 'function') { + this.props.onChange(ev); + } } }); diff --git a/components/radio/index.jsx b/components/radio/index.jsx index b66782798d..1f06a282a3 100644 --- a/components/radio/index.jsx +++ b/components/radio/index.jsx @@ -8,10 +8,9 @@ var AntRadio = React.createClass({ }; }, render() { - return ( ); diff --git a/style/components/radio.less b/style/components/radio.less index 7fe9b62c2e..d51e7814a6 100644 --- a/style/components/radio.less +++ b/style/components/radio.less @@ -4,8 +4,8 @@ @radioDuration: .3s; .@{radioGroupPrefixCls} { - & label{ - margin-right: 10px; + label { + margin-right: 16px; } }