mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 21:19:37 +08:00
Fix radio style prop
This commit is contained in:
parent
958a74e028
commit
a45ed7ee4c
@ -13,27 +13,26 @@ const RadioGroup = Radio.Group;
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
value: 1
|
||||
value: 1,
|
||||
};
|
||||
},
|
||||
onChange(e) {
|
||||
console.log('radio checked', e.target.value);
|
||||
this.setState({
|
||||
value: e.target.value
|
||||
value: e.target.value,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<RadioGroup onChange={this.onChange} value={this.state.value}>
|
||||
<Radio key="a" value={1}>A</Radio>
|
||||
<Radio key="b" value={2}>B</Radio>
|
||||
<Radio key="c" value={3}>C</Radio>
|
||||
<Radio key="d" value={null}>D</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<RadioGroup onChange={this.onChange} value={this.state.value}>
|
||||
<Radio key="a" value={1}>A</Radio>
|
||||
<Radio key="b" value={2}>B</Radio>
|
||||
<Radio key="c" value={3}>C</Radio>
|
||||
<Radio key="d" value={null}>D</Radio>
|
||||
</RadioGroup>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
````
|
||||
|
@ -9,7 +9,7 @@ const AntRadio = React.createClass({
|
||||
};
|
||||
},
|
||||
render() {
|
||||
const { prefixCls, children, checked, disabled, className } = this.props;
|
||||
const { prefixCls, children, checked, disabled, className, style } = this.props;
|
||||
const classString = classNames({
|
||||
[prefixCls]: true,
|
||||
[`${prefixCls}-checked`]: checked,
|
||||
@ -17,8 +17,8 @@ const AntRadio = React.createClass({
|
||||
[className]: !!className,
|
||||
});
|
||||
return (
|
||||
<label className={classString}>
|
||||
<Radio {...this.props} children={null} />
|
||||
<label className={classString} style={style}>
|
||||
<Radio {...this.props} style={null} children={null} />
|
||||
{children}
|
||||
</label>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user