mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 07:39:36 +08:00
eaae43abdd
This covers Carousel, InputNumber, Select, Slider, Switch, TreeSelect and Tree.
19 lines
456 B
JavaScript
19 lines
456 B
JavaScript
import RcSwitch from 'rc-switch';
|
|
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default class Switch extends React.Component {
|
|
render() {
|
|
const { prefixCls, size, className } = this.props;
|
|
const cls = classNames({
|
|
[className]: !!className,
|
|
[`${prefixCls}-small`]: size === 'small',
|
|
});
|
|
return <RcSwitch className={cls} {...this.props} />;
|
|
}
|
|
}
|
|
|
|
Switch.defaultProps = {
|
|
prefixCls: 'ant-switch',
|
|
};
|