mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
956bf1bbe0
@ -9,7 +9,5 @@
|
||||
````jsx
|
||||
var Radio = antd.Radio;
|
||||
|
||||
React.render(<label>
|
||||
<Radio />Radio
|
||||
</label>, document.getElementById('components-radio-demo-basic'));
|
||||
React.render(<Radio >Radio</Radio>, document.getElementById('components-radio-demo-basic'));
|
||||
````
|
||||
|
@ -26,9 +26,9 @@ var App = React.createClass({
|
||||
},
|
||||
render() {
|
||||
return <div>
|
||||
<Radio defaultChecked={false} disabled={this.state.disabled} />不可用
|
||||
<Radio defaultChecked={false} disabled={this.state.disabled}>不可用</Radio>
|
||||
<br />
|
||||
<Radio defaultChecked={true} disabled={this.state.disabled} />不可用
|
||||
<Radio defaultChecked={true} disabled={this.state.disabled}>不可用</Radio>
|
||||
<div style={{marginTop: 20}}>
|
||||
<button className="ant-btn ant-btn-primary" onClick={this.toggleDisabled}>
|
||||
Toggle disabled
|
||||
|
@ -1,5 +1,5 @@
|
||||
var React = require('react');
|
||||
var Radio = require('rc-radio');
|
||||
var Radio = require('./index');
|
||||
|
||||
var AntRadioGroup = React.createClass({
|
||||
getDefaultProps: function () {
|
||||
@ -24,14 +24,10 @@ var AntRadioGroup = React.createClass({
|
||||
var props = self.props;
|
||||
var children = props.children.map(function (radio) {
|
||||
if (radio.props) {
|
||||
return <label>
|
||||
<Radio {...radio.props}
|
||||
onChange={self.onRadioChange}
|
||||
checked = {self.state.selectedValue === radio.props.value}
|
||||
children={null}
|
||||
/>
|
||||
{radio.props.children}
|
||||
</label>;
|
||||
return <Radio {...radio.props}
|
||||
onChange={self.onRadioChange}
|
||||
checked = {self.state.selectedValue === radio.props.value}
|
||||
/>;
|
||||
}
|
||||
return radio;
|
||||
});
|
||||
|
@ -8,7 +8,13 @@ var AntRadio = React.createClass({
|
||||
};
|
||||
},
|
||||
render() {
|
||||
return <Radio {...this.props} />;
|
||||
|
||||
return (
|
||||
<label>
|
||||
<Radio {...this.props} children={null}/>
|
||||
{this.props.children}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user