mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
update radio demos
This commit is contained in:
parent
826e126c7e
commit
9f6a9d9af0
@ -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'));
|
||||
````
|
||||
|
@ -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>
|
||||
你选中的: {this.state.value}
|
||||
<div style={{marginTop: 20}}>你选中的: {this.state.value}</div>
|
||||
</div>
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user