ant-design/components/radio/demo/radiobutton.md
2015-08-21 19:16:03 +08:00

27 lines
569 B
Markdown

# 按钮样式
- order: 3
按钮样式的单选组合。
---
````jsx
var RadioButton = antd.Radio.Button;
var RadioGroup = antd.Radio.Group;
function onChange(e) {
console.log('radio checked:' + e.target.value);
}
React.render((
<RadioGroup onChange={onChange} defaultValue="a">
<RadioButton value="a">杭州</RadioButton>
<RadioButton value="b">上海</RadioButton>
<RadioButton value="c">北京</RadioButton>
<RadioButton value="d">成都</RadioButton>
</RadioGroup>
), document.getElementById('components-radio-demo-radiobutton'));
````