Browse Source

Merge branch 'master' of github.com:ant-design/ant-design

pull/76/head
jljsj 9 years ago
parent
commit
8a89010663
  1. 16
      components/form/demo/mix.md
  2. 13
      components/radio/demo/radiogroup.md
  3. 3
      components/radio/group.jsx
  4. 1
      components/radio/index.jsx
  5. 2
      package.json
  6. 4
      style/components/radio.less

16
components/form/demo/mix.md

@ -17,6 +17,7 @@ var Dropdown = antd.Dropdown;
var Slider = antd.Slider;
var Checkbox = antd.Checkbox;
var Radio = antd.Radio;
var RadioGroup = antd.RadioGroup;
var menu = <Menu>
<Menu.Item>
@ -101,15 +102,12 @@ React.render(
<div className="ant-form-item ant-form-item-compact">
<label for="" className="col-6" required>ant-radio:</label>
<div className="col-16">
<label className="ant-radio-inline">
<Radio name="radio" />选项一
</label>
<label className="ant-radio-inline">
<Radio name="radio" />选项二
</label>
<label className="ant-radio-inline">
<Radio name="radio" />选项三
</label>
<RadioGroup>
<Radio value="a" checked={true}>选项一</Radio>
<Radio value="b">选项二</Radio>
<Radio value="c">选项三</Radio>
<Radio value="d">选项四</Radio>
</RadioGroup>
</div>
</div>
<div className="ant-form-item ant-form-item-compact">

13
components/radio/demo/radiogroup.md

@ -10,7 +10,7 @@ RadioGroup 组合。
var Radio = antd.Radio;
var RadioGroup = antd.RadioGroup;
var Group = React.createClass({
var App = React.createClass({
getInitialState: function () {
return {
selectedValue:"a"
@ -25,15 +25,14 @@ var Group = React.createClass({
render() {
return<div>
<RadioGroup onChange={this.onChange}>
<Radio value={"a"} checked={true}>A</Radio>
<Radio value={"b"} >B</Radio>
<Radio value={"c"} >C</Radio>
<Radio value={"d"} disabled={true}>D</Radio>
<Radio value="a" checked={true}>A</Radio>
<Radio value="b" >B</Radio>
<Radio value="c" >C</Radio>
<Radio value="d" disabled={true}>D</Radio>
</RadioGroup>
你选中的:&nbsp;&nbsp;{this.state.selectedValue}
</div>
}
});
React.render(<Group />, document.getElementById('components-radio-demo-radiogroup'));
React.render(<App />, document.getElementById('components-radio-demo-radiogroup'));
````

3
components/radio/group.jsx

@ -41,9 +41,10 @@ var AntRadioGroup = React.createClass({
this.setState({
selectedValue: ev.target.value
});
if (typeof this.props.onChange === 'function') {
this.props.onChange(ev);
}
}
});
module.exports = AntRadioGroup;

1
components/radio/index.jsx

@ -8,7 +8,6 @@ var AntRadio = React.createClass({
};
},
render() {
return (
<label>
<Radio {...this.props} children={null} />

2
package.json

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "0.7.0-beta2",
"version": "0.7.0-beta1",
"title": "Ant Design",
"description": "一个设计&前端框架",
"homepage": "http://ant.design/",

4
style/components/radio.less

@ -4,8 +4,8 @@
@radioDuration: .3s;
.@{radioGroupPrefixCls} {
& label{
margin-right: 10px;
label {
margin-right: 16px;
}
}

Loading…
Cancel
Save