From c28c38d02eb25bbafcde00a98f6cc0e157adf7e2 Mon Sep 17 00:00:00 2001 From: Carl Chen <71313168+cc-hearts@users.noreply.github.com> Date: Fri, 19 Apr 2024 22:56:07 +0800 Subject: [PATCH] fix[Select|Cascader]: select multiple error & cascader error in ssr mode (#7377) * docs: updating the `dropdownRender` description and jumps in the FAQ for Select * fix: fix select error in multiple mode * fix: fix cascader select error in ssr mode --- components/vc-cascader/OptionList/Column.tsx | 5 +++-- components/vc-select/TransBtn.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/vc-cascader/OptionList/Column.tsx b/components/vc-cascader/OptionList/Column.tsx index 81df3f417..e337f5f58 100644 --- a/components/vc-cascader/OptionList/Column.tsx +++ b/components/vc-cascader/OptionList/Column.tsx @@ -4,6 +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'; export const FIX_LABEL = '__cascader_fix_label__'; export interface ColumnProps { prefixCls: string; @@ -151,10 +152,10 @@ export default function Column({ )}
{label}
{!isLoading && expandIcon && !isMergedLeaf && ( -
{expandIcon}
+
{cloneVNode(expandIcon)}
)} {isLoading && loadingIcon && ( -
{loadingIcon}
+
{cloneVNode(loadingIcon)}
)} ); diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index 22578cb7b..c29d3982c 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -1,4 +1,4 @@ -import type { FunctionalComponent, PropType } from 'vue'; +import { cloneVNode, type FunctionalComponent, type PropType } from 'vue'; import type { MouseEventHandler } from '../_util/EventInterface'; import type { VueNode } from '../_util/type'; import PropTypes from '../_util/vue-types'; @@ -23,7 +23,7 @@ const TransBtn: TransBtnType = (props, { slots }) => { if (typeof customizeIcon === 'function') { icon = customizeIcon(customizeIconProps); } else { - icon = customizeIcon; + icon = cloneVNode(customizeIcon); } return (