File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { DefaultOptionType, SingleValueType } from '../Cascader';
4
4
import { SEARCH_MARK } from '../hooks/useSearchOptions' ;
5
5
import type { Key } from '../../_util/type' ;
6
6
import { useInjectCascader } from '../context' ;
7
- import { cloneVNode } from 'vue ' ;
7
+ import { cloneElement } from '../../_util/vnode ' ;
8
8
export const FIX_LABEL = '__cascader_fix_label__' ;
9
9
export interface ColumnProps {
10
10
prefixCls : string ;
@@ -152,10 +152,10 @@ export default function Column({
152
152
) }
153
153
< div class = { `${ menuItemPrefixCls } -content` } > { label } </ div >
154
154
{ ! isLoading && expandIcon && ! isMergedLeaf && (
155
- < div class = { `${ menuItemPrefixCls } -expand-icon` } > { cloneVNode ( expandIcon ) } </ div >
155
+ < div class = { `${ menuItemPrefixCls } -expand-icon` } > { cloneElement ( expandIcon ) } </ div >
156
156
) }
157
157
{ isLoading && loadingIcon && (
158
- < div class = { `${ menuItemPrefixCls } -loading-icon` } > { cloneVNode ( loadingIcon ) } </ div >
158
+ < div class = { `${ menuItemPrefixCls } -loading-icon` } > { cloneElement ( loadingIcon ) } </ div >
159
159
) }
160
160
</ li >
161
161
) ;
Original file line number Diff line number Diff line change 1
- import { cloneVNode } from 'vue' ;
1
+ import { cloneVNode , isVNode } from 'vue' ;
2
2
import type { VNode , FunctionalComponent , PropType } from 'vue' ;
3
3
import type { MouseEventHandler } from '../_util/EventInterface' ;
4
4
import type { VueNode } from '../_util/type' ;
@@ -24,7 +24,7 @@ const TransBtn: TransBtnType = (props, { slots }) => {
24
24
if ( typeof customizeIcon === 'function' ) {
25
25
icon = customizeIcon ( customizeIconProps ) ;
26
26
} else {
27
- icon = cloneVNode ( customizeIcon as VNode ) ;
27
+ icon = isVNode ( customizeIcon ) ? cloneVNode ( customizeIcon as VNode ) : customizeIcon ;
28
28
}
29
29
30
30
return (
You can’t perform that action at this time.
0 commit comments