update radio demos

This commit is contained in:
afc163 2015-07-21 16:18:27 +08:00
parent 826e126c7e
commit 9f6a9d9af0
2 changed files with 11 additions and 10 deletions

View File

@ -9,5 +9,6 @@
````jsx
var Radio = antd.Radio;
React.render(<Radio >Radio</Radio>, document.getElementById('components-radio-demo-basic'));
React.render(<Radio>Radio</Radio>
, document.getElementById('components-radio-demo-basic'));
````

View File

@ -13,24 +13,24 @@ var RadioGroup = antd.RadioGroup;
var App = React.createClass({
getInitialState: function () {
return {
value:"a"
value: 'a'
};
},
onChange(ev) {
console.log('radio checked:' + ev.target.value);
onChange(e) {
console.log('radio checked:' + e.target.value);
this.setState({
value:ev.target.value
})
value: e.target.value
});
},
render() {
return<div>
<RadioGroup onChange={this.onChange} value={this.state.value}>
<Radio value="a">A</Radio>
<Radio value="b" >B</Radio>
<Radio value="c" >C</Radio>
<Radio value="d" disabled={true}>D</Radio>
<Radio value="b">B</Radio>
<Radio value="c">C</Radio>
<Radio value="d">D</Radio>
</RadioGroup>
你选中的:&nbsp;&nbsp;{this.state.value}
<div style={{marginTop: 20}}>你选中的: {this.state.value}</div>
</div>
}
});