From 6a2f1c2362211e3572485c11dc67ba806bc5af59 Mon Sep 17 00:00:00 2001 From: carl-chen Date: Thu, 25 Jan 2024 22:56:52 +0800 Subject: [PATCH 1/3] docs: updating the `dropdownRender` description and jumps in the FAQ for Select --- components/select/index.en-US.md | 2 +- components/select/index.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md index b2e25873ec..136217e541 100644 --- a/components/select/index.en-US.md +++ b/components/select/index.en-US.md @@ -117,7 +117,7 @@ Select component to select value from options. ### The dropdown is closed when click `dropdownRender` area? -Dropdown menu will be closed if click `dropdownRender` area, you can prevent it by wrapping `@mousedown.prevent` See the [dropdownRender example](/components/select/#components-select-demo-custom-dropdown). +Dropdown menu will be closed if click `dropdownRender` area, you can prevent the default behavior of a click event, See the [dropdownRender example](#components-select-demo-custom-dropdown-menu). ### Why is `placeholder` not displayed? diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index d4d49a3806..4de3bf8ae4 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -117,7 +117,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*5oPiTqPxGAUAAA ### 点击 `dropdownRender` 里的内容浮层关闭怎么办? -自定义内容点击时会关闭浮层,如果不喜欢关闭,可以添加 `@mousedown.prevent` 进行阻止。 看下 [dropdownRender 例子](/components/select-cn/#components-select-demo-custom-dropdown) 里的说明。 +自定义内容点击时会关闭浮层,如果不喜欢关闭,可以通过取消点击事件的默认行为进行阻止。 看下 [dropdownRender 例子](#components-select-demo-custom-dropdown-menu) 里的说明。 ### 为什么 `placeholder` 不显示 ? From 70d41c0372d2c5a77db803b7c8290442fb1e569e Mon Sep 17 00:00:00 2001 From: carl-chen Date: Fri, 23 Feb 2024 21:08:26 +0800 Subject: [PATCH 2/3] fix: fix select error in multiple mode --- components/vc-select/TransBtn.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index 22578cb7bc..c29d3982c9 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 ( From 406f3ce54a67d1b180e38ea0f8c67dbea0d117db Mon Sep 17 00:00:00 2001 From: carl-chen Date: Fri, 23 Feb 2024 21:13:05 +0800 Subject: [PATCH 3/3] fix: fix cascader select error in ssr mode --- components/vc-cascader/OptionList/Column.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/vc-cascader/OptionList/Column.tsx b/components/vc-cascader/OptionList/Column.tsx index 81df3f417f..e337f5f580 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)}
)} );