mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 21:59:41 +08:00
25 lines
668 B
JavaScript
25 lines
668 B
JavaScript
import RcRadio from 'rc-radio';
|
|
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default class Radio extends React.Component {
|
|
static defaultProps = {
|
|
prefixCls: 'ant-radio'
|
|
}
|
|
render() {
|
|
const { prefixCls, children, checked, disabled, className, style } = this.props;
|
|
const classString = classNames({
|
|
[prefixCls]: true,
|
|
[`${prefixCls}-checked`]: checked,
|
|
[`${prefixCls}-disabled`]: disabled,
|
|
[className]: !!className,
|
|
});
|
|
return (
|
|
<label className={classString} style={style}>
|
|
<RcRadio {...this.props} style={null} children={null} />
|
|
{children}
|
|
</label>
|
|
);
|
|
}
|
|
}
|