import RcRadio from 'rc-radio'; import React from 'react'; import classNames from 'classnames'; import PureRenderMixin from 'rc-util/lib/PureRenderMixin'; export interface RadioProps { /** 指定当前是否选中*/ checked?: boolean; /** 初始是否选中*/ defaultChecked?: boolean; /** 根据 value 进行比较,判断是否选中 */ value?: any; style?: React.CSSProperties; prefixCls?: string; disabled?: boolean; className?: string; onChange?: (e: any) => any; onMouseEnter?: React.FormEventHandler; onMouseLeave?: React.FormEventHandler; } export default class Radio extends React.Component { static Group: any; static Button: any; static defaultProps = { prefixCls: 'ant-radio', }; shouldComponentUpdate(...args) { return PureRenderMixin.shouldComponentUpdate.apply(this, args); } render() { const { prefixCls, className, children, style, ...restProps } = this.props; const wrapperClassString = classNames({ [`${prefixCls}-wrapper`]: true, [`${prefixCls}-wrapper-checked`]: restProps.checked, [`${prefixCls}-wrapper-disabled`]: restProps.disabled, }, className); return ( ); } }