From 407b86c5ee58eeea538b52d7a48f6ef030db2560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Fri, 17 Jan 2025 17:23:55 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8Ddebounce=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/utils/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/simple-mind-map/src/utils/index.js b/simple-mind-map/src/utils/index.js index ea759932..59af46da 100644 --- a/simple-mind-map/src/utils/index.js +++ b/simple-mind-map/src/utils/index.js @@ -297,12 +297,10 @@ export const debounce = (fn, wait = 300, ctx) => { return (...args) => { if (timeout) clearTimeout(timeout) - const callNow = !timeout timeout = setTimeout(() => { timeout = null fn.apply(ctx, args) }, wait) - if (callNow) fn.apply(ctx, args) } }