From 7a0aa39d5da81ffe372097882e7b97b763023ec6 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 9 Mar 2026 15:06:59 +0800 Subject: [PATCH] =?UTF-8?q?chore(=E9=98=B2=E6=8A=96=E8=8A=82=E6=B5=81?= =?UTF-8?q?=E5=B7=A5=E5=85=B7):=20=E6=96=B0=E5=A2=9E=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/useDebounce.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/useDebounce.js b/src/utils/useDebounce.js index 69da5c5..237e21d 100644 --- a/src/utils/useDebounce.js +++ b/src/utils/useDebounce.js @@ -1,6 +1,6 @@ import { getCurrentInstance, onUnmounted } from 'vue' -// 防抖 +// 防抖(仅在最新一次请求的计时结束后执行) export function useDebounce(fn, delay = 500, immediate = false) { let timer = null let instance = getCurrentInstance() // 获取当前组件实例 @@ -42,7 +42,7 @@ export function useDebounce(fn, delay = 500, immediate = false) { return debounced } -// 节流 +// 节流(执行第一次请求,直到计时器结束,才可以重新请求) export function useThrottle(fn, delay = 1000) { let lastCall = 0