ant-design/components/radio/radio.jsx

28 lines
625 B
React
Raw Normal View History

2015-08-21 18:24:09 +08:00
import Radio from 'rc-radio';
import React from 'react';
const AntRadio = React.createClass({
2015-08-21 18:24:09 +08:00
getDefaultProps() {
return {
prefixCls: 'ant-radio'
};
},
render() {
2015-08-21 19:16:03 +08:00
let classString = this.props.className;
if (classString) {
classString += this.props.checked ? (' ' + classString + '-checked') : '';
}
if (this.props.disabled) {
classString += ' ' + this.props.className + '-disabled';
}
2015-08-21 18:24:09 +08:00
return (
2015-08-21 19:16:03 +08:00
<label className={classString}>
2015-08-21 18:24:09 +08:00
<Radio {...this.props} children={null} />
{this.props.children}
</label>
);
}
});
export default AntRadio;