mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
19 lines
461 B
TypeScript
19 lines
461 B
TypeScript
import RcSwitch from 'rc-switch';
|
|
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default class Switch extends React.Component {
|
|
static defaultProps = {
|
|
prefixCls: 'ant-switch',
|
|
}
|
|
|
|
render() {
|
|
const { prefixCls, size, className } = this.props;
|
|
const cls = classNames({
|
|
[className]: !!className,
|
|
[`${prefixCls}-small`]: size === 'small',
|
|
});
|
|
return <RcSwitch className={cls} {...this.props} />;
|
|
}
|
|
}
|