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) {