From 1cdfa5d11231147e62d9a2b4677f2cf9f72f9c29 Mon Sep 17 00:00:00 2001 From: castleiMac Date: Sun, 3 Apr 2022 17:33:20 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20select=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9Esearch=E4=BA=8B=E4=BB=B6=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E8=A7=A6=E5=8F=91=E8=BF=9C=E7=A8=8B=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=88=96=E8=87=AA=E5=AE=9A=E4=B9=89=E6=90=9C=E7=B4=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/docs/zh-CN/components/select.md | 31 +++++++++++++++++++++++++ src/component/select/index.vue | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/example/docs/zh-CN/components/select.md b/example/docs/zh-CN/components/select.md index 6319b36b..637e7451 100644 --- a/example/docs/zh-CN/components/select.md +++ b/example/docs/zh-CN/components/select.md @@ -100,6 +100,37 @@ export default { ::: +::: title 关键词变化事件,可作为远程搜索处理算法 +::: + +::: demo + + + + + +::: + ::: title 海量数据 ::: diff --git a/src/component/select/index.vue b/src/component/select/index.vue index a80791a2..57d2cf2b 100644 --- a/src/component/select/index.vue +++ b/src/component/select/index.vue @@ -56,7 +56,7 @@ const open = function () { openState.value = !openState.value; }; -const emit = defineEmits(["update:modelValue", "change"]); +const emit = defineEmits(["update:modelValue", "change", 'search']); const selectItem = ref({ value: !props.multiple ? props.modelValue @@ -101,6 +101,7 @@ const input = ref(false) const value = computed({ set(v: any) { txt.value = v; + emit('search', v) }, get() { if (input.value) {