From 0bfec4fd7fa387a371f3d4b753155d9e6d4fed84 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Jul 2015 16:43:20 +0800 Subject: [PATCH 1/3] code style --- components/radio/demo/radiogroup.md | 15 +++++++-------- components/radio/group.jsx | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/components/radio/demo/radiogroup.md b/components/radio/demo/radiogroup.md index 2fad188dd4..659386814e 100644 --- a/components/radio/demo/radiogroup.md +++ b/components/radio/demo/radiogroup.md @@ -8,9 +8,9 @@ RadioGroup 组合。 ````jsx var Radio = antd.Radio; -var RadioGroup=antd.RadioGroup; +var RadioGroup = antd.RadioGroup; -var Group = React.createClass({ +var App = React.createClass({ getInitialState: function () { return { selectedValue:"a" @@ -25,15 +25,14 @@ var Group = React.createClass({ render() { return
- A - B - C - D + A + B + C + D 你选中的:  {this.state.selectedValue}
} }); -React.render(, document.getElementById('components-radio-demo-radiogroup')); - +React.render(, document.getElementById('components-radio-demo-radiogroup')); ```` diff --git a/components/radio/group.jsx b/components/radio/group.jsx index 34f9bc0eea..82d40957ba 100644 --- a/components/radio/group.jsx +++ b/components/radio/group.jsx @@ -37,7 +37,7 @@ var AntRadioGroup = React.createClass({ }); return (
- {children} + {children}
); }, @@ -50,4 +50,3 @@ var AntRadioGroup = React.createClass({ }); module.exports = AntRadioGroup; - From ddc3f83d768d9c935dc7f6d5eb60616b449beb8d Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Jul 2015 17:31:56 +0800 Subject: [PATCH 2/3] 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; } } From 269843bd07122a5046b3bee256da369c4430982b Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 17 Jul 2015 17:32:29 +0800 Subject: [PATCH 3/3] beta1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07838ec1df..60f103999d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.7.0-beta2", + "version": "0.7.0-beta1", "title": "Ant Design", "description": "一个设计&前端框架", "homepage": "http://ant.design/",