From 710f61638924d42e607378a5376c00994298aadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sun, 20 Nov 2022 18:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(select):=20=E6=96=B0=E5=A2=9E=20searc?= =?UTF-8?q?h-method=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/select/index.vue | 4 ++-- .../component/src/component/selectOption/index.vue | 13 ++++++++++--- .../src/document/zh-CN/components/select.md | 11 +++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/package/component/src/component/select/index.vue b/package/component/src/component/select/index.vue index 40e7d8da..2d65f808 100644 --- a/package/component/src/component/select/index.vue +++ b/package/component/src/component/select/index.vue @@ -31,6 +31,7 @@ export interface SelectProps { disabled?: boolean; placeholder?: string; searchPlaceholder?: string; + searchMethod?: Function; modelValue?: any; multiple?: boolean; items?: SelectOptionProps[]; @@ -81,7 +82,6 @@ const getOption = (nodes: VNode[], newOptions: any[]) => { if (item.children) { // @ts-ignore const label = item.children.default()[0].children; - if (typeof label == "string") { // @ts-ignore item.props.label = label; @@ -122,7 +122,6 @@ const onCompositionend = (event: Event) => { onMounted(() => { intOption(); timer = setInterval(intOption, 500); - watch( [selectedValue, options], () => { @@ -188,6 +187,7 @@ provide("openState", openState); provide("selectedValue", selectedValue); provide("searchValue", searchValue); provide("multiple", multiple); +provide("searchMethod", props.searchMethod);