From 23c620ea3a0548a0129d9e5f82fc2a2335da1bf5 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 22 Apr 2024 15:26:02 +0800 Subject: [PATCH] fix: select customicon error #7377 --- components/vc-cascader/OptionList/Column.tsx | 6 +++--- components/vc-select/TransBtn.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/vc-cascader/OptionList/Column.tsx b/components/vc-cascader/OptionList/Column.tsx index e337f5f58..15c10bcbd 100644 --- a/components/vc-cascader/OptionList/Column.tsx +++ b/components/vc-cascader/OptionList/Column.tsx @@ -4,7 +4,7 @@ import type { DefaultOptionType, SingleValueType } from '../Cascader'; import { SEARCH_MARK } from '../hooks/useSearchOptions'; import type { Key } from '../../_util/type'; import { useInjectCascader } from '../context'; -import { cloneVNode } from 'vue'; +import { cloneElement } from '../../_util/vnode'; export const FIX_LABEL = '__cascader_fix_label__'; export interface ColumnProps { prefixCls: string; @@ -152,10 +152,10 @@ export default function Column({ )}
{!isLoading && expandIcon && !isMergedLeaf && ( - + )} {isLoading && loadingIcon && ( - + )} ); diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index f47e5dc6b..fd730a300 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -1,4 +1,4 @@ -import { cloneVNode } from 'vue'; +import { cloneVNode, isVNode } from 'vue'; import type { VNode, FunctionalComponent, PropType } from 'vue'; import type { MouseEventHandler } from '../_util/EventInterface'; import type { VueNode } from '../_util/type'; @@ -24,7 +24,7 @@ const TransBtn: TransBtnType = (props, { slots }) => { if (typeof customizeIcon === 'function') { icon = customizeIcon(customizeIconProps); } else { - icon = cloneVNode(customizeIcon as VNode); + icon = isVNode(customizeIcon) ? cloneVNode(customizeIcon as VNode) : customizeIcon; } return (