Skip to content

Commit c28c38d

Browse files
authored
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
1 parent 162d1fc commit c28c38d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

components/vc-cascader/OptionList/Column.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { DefaultOptionType, SingleValueType } from '../Cascader';
44
import { SEARCH_MARK } from '../hooks/useSearchOptions';
55
import type { Key } from '../../_util/type';
66
import { useInjectCascader } from '../context';
7+
import { cloneVNode } from 'vue';
78
export const FIX_LABEL = '__cascader_fix_label__';
89
export interface ColumnProps {
910
prefixCls: string;
@@ -151,10 +152,10 @@ export default function Column({
151152
)}
152153
<div class={`${menuItemPrefixCls}-content`}>{label}</div>
153154
{!isLoading && expandIcon && !isMergedLeaf && (
154-
<div class={`${menuItemPrefixCls}-expand-icon`}>{expandIcon}</div>
155+
<div class={`${menuItemPrefixCls}-expand-icon`}>{cloneVNode(expandIcon)}</div>
155156
)}
156157
{isLoading && loadingIcon && (
157-
<div class={`${menuItemPrefixCls}-loading-icon`}>{loadingIcon}</div>
158+
<div class={`${menuItemPrefixCls}-loading-icon`}>{cloneVNode(loadingIcon)}</div>
158159
)}
159160
</li>
160161
);

components/vc-select/TransBtn.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FunctionalComponent, PropType } from 'vue';
1+
import { cloneVNode, type FunctionalComponent, type PropType } from 'vue';
22
import type { MouseEventHandler } from '../_util/EventInterface';
33
import type { VueNode } from '../_util/type';
44
import PropTypes from '../_util/vue-types';
@@ -23,7 +23,7 @@ const TransBtn: TransBtnType = (props, { slots }) => {
2323
if (typeof customizeIcon === 'function') {
2424
icon = customizeIcon(customizeIconProps);
2525
} else {
26-
icon = customizeIcon;
26+
icon = cloneVNode(customizeIcon);
2727
}
2828

2929
return (

0 commit comments

Comments
 (0)