diff --git a/components/switch/demo/text.md b/components/switch/demo/text.md index 1c7996d9f..cb580b58a 100644 --- a/components/switch/demo/text.md +++ b/components/switch/demo/text.md @@ -17,7 +17,7 @@ With text and icon.
- + diff --git a/components/switch/index.jsx b/components/switch/index.jsx index b9a86131f..2f9066605 100644 --- a/components/switch/index.jsx +++ b/components/switch/index.jsx @@ -3,6 +3,7 @@ import PropTypes from '../_util/vue-types' import { getOptionProps, getComponentFromProp } from '../_util/props-util' import VcSwitch from '../vc-switch' import Wave from '../_util/wave' +import Icon from '../icon' const Switch = { name: 'ASwitch', @@ -38,10 +39,17 @@ const Switch = { [`${prefixCls}-small`]: size === 'small', [`${prefixCls}-loading`]: loading, } + const loadingIcon = loading ? ( + + ) : null const switchProps = { props: { ...restProps, prefixCls, + loadingIcon, }, on: this.$listeners, class: classes,