mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 05:29: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({
|
const App = React.createClass({
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
value: 1
|
value: 1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
console.log('radio checked', e.target.value);
|
console.log('radio checked', e.target.value);
|
||||||
this.setState({
|
this.setState({
|
||||||
value: e.target.value
|
value: e.target.value,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<RadioGroup onChange={this.onChange} value={this.state.value}>
|
||||||
<RadioGroup onChange={this.onChange} value={this.state.value}>
|
<Radio key="a" value={1}>A</Radio>
|
||||||
<Radio key="a" value={1}>A</Radio>
|
<Radio key="b" value={2}>B</Radio>
|
||||||
<Radio key="b" value={2}>B</Radio>
|
<Radio key="c" value={3}>C</Radio>
|
||||||
<Radio key="c" value={3}>C</Radio>
|
<Radio key="d" value={null}>D</Radio>
|
||||||
<Radio key="d" value={null}>D</Radio>
|
</RadioGroup>
|
||||||
</RadioGroup>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(<App />, mountNode);
|
ReactDOM.render(<App />, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -9,7 +9,7 @@ const AntRadio = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { prefixCls, children, checked, disabled, className } = this.props;
|
const { prefixCls, children, checked, disabled, className, style } = this.props;
|
||||||
const classString = classNames({
|
const classString = classNames({
|
||||||
[prefixCls]: true,
|
[prefixCls]: true,
|
||||||
[`${prefixCls}-checked`]: checked,
|
[`${prefixCls}-checked`]: checked,
|
||||||
@ -17,8 +17,8 @@ const AntRadio = React.createClass({
|
|||||||
[className]: !!className,
|
[className]: !!className,
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<label className={classString}>
|
<label className={classString} style={style}>
|
||||||
<Radio {...this.props} children={null} />
|
<Radio {...this.props} style={null} children={null} />
|
||||||
{children}
|
{children}
|
||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user