From d3171f4c69189c7326fc5e43d18f8b04af62be20 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 20 Oct 2023 16:56:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E6=90=9C=E7=B4=A2=E9=98=B2?= =?UTF-8?q?=E6=8A=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/components/SearchInput.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/SearchInput.vue b/packages/editor/src/components/SearchInput.vue index 35f31c652..d5af36cea 100644 --- a/packages/editor/src/components/SearchInput.vue +++ b/packages/editor/src/components/SearchInput.vue @@ -27,7 +27,11 @@ const emit = defineEmits(['search']); const filterText = ref(''); +let timer: NodeJS.Timeout | null = null; const filterTextChangeHandler = () => { - emit('search', filterText.value); + timer && clearTimeout(timer); + timer = setTimeout(() => { + emit('search', filterText.value); + }, 300); };