mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-21 00:43:45 +08:00
feat(editor): 搜索防抖
This commit is contained in:
parent
04025682d5
commit
d3171f4c69
@ -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);
|
||||
};
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user