mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
19 lines
461 B
JavaScript
19 lines
461 B
JavaScript
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} />;
|
|
}
|
|
}
|