提交 17fa990a 编写于 作者: A afc163

Add vertical RadioGroup demo, close #1119

上级 6d24a3f0
# RadioGroup 垂直
- order: 2
垂直的 RadioGroup,配合更多输入框选项。
---
````jsx
import { Radio, Input } from 'antd';
const RadioGroup = Radio.Group;
const App = React.createClass({
getInitialState() {
return {
value: 1,
};
},
onChange(e) {
console.log('radio checked', e.target.value);
this.setState({
value: e.target.value,
});
},
render() {
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
};
return (
<RadioGroup onChange={this.onChange} value={this.state.value}>
<Radio style={radioStyle} key="a" value={1}>Option A</Radio>
<Radio style={radioStyle} key="b" value={2}>Option B</Radio>
<Radio style={radioStyle} key="c" value={3}>Option C</Radio>
<Radio style={radioStyle} key="d" value={4}>
More...
{this.state.value === 4 ? <Input style={{ width: 100, marginLeft: 10 }} /> : null}
</Radio>
</RadioGroup>
);
}
});
ReactDOM.render(<App />, mountNode);
````
......@@ -83,6 +83,6 @@ export default React.createClass({
[props.prefixCls]: true,
[`${props.prefixCls}-${props.size}`]: props.size,
});
return <div className={classString}>{children}</div>;
return <div className={classString} style={props.style}>{children}</div>;
},
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册