@@ -11,10 +11,10 @@ import {
11
11
} from 'vue' ;
12
12
import Wave from '../_util/wave' ;
13
13
import buttonTypes from './buttonTypes' ;
14
- import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined' ;
15
- import { flattenChildren , getPropsSlot , initDefaultProps } from '../_util/props-util' ;
14
+ import { flattenChildren , initDefaultProps } from '../_util/props-util' ;
16
15
import useConfigInject from '../_util/hooks/useConfigInject' ;
17
16
import devWarning from '../vc-util/devWarning' ;
17
+ import LoadingIcon from './LoadingIcon' ;
18
18
19
19
import type { ButtonType } from './buttonTypes' ;
20
20
import type { VNode , Ref } from 'vue' ;
@@ -146,9 +146,8 @@ export default defineComponent({
146
146
} ) ;
147
147
148
148
return ( ) => {
149
- const children = flattenChildren ( getPropsSlot ( slots , props ) ) ;
150
-
151
- const icon = getPropsSlot ( slots , props , 'icon' ) ;
149
+ const { icon = slots . icon ?.( ) } = props ;
150
+ const children = flattenChildren ( slots . default ?.( ) ) ;
152
151
153
152
isNeedInserted = children . length === 1 && ! icon && ! isUnborderedButtonType ( props . type ) ;
154
153
@@ -171,7 +170,16 @@ export default defineComponent({
171
170
delete buttonProps . disabled ;
172
171
}
173
172
174
- const iconNode = innerLoading . value ? < LoadingOutlined /> : icon ;
173
+ const iconNode =
174
+ icon && ! innerLoading . value ? (
175
+ icon
176
+ ) : (
177
+ < LoadingIcon
178
+ existIcon = { ! ! icon }
179
+ prefixCls = { prefixCls . value }
180
+ loading = { ! ! innerLoading . value }
181
+ />
182
+ ) ;
175
183
176
184
const kids = children . map ( child =>
177
185
insertSpace ( child , isNeedInserted && autoInsertSpace . value ) ,
0 commit comments