Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useDebounce如何对Button的单击事件做防抖? #2696

Open
459319819 opened this issue Dec 7, 2024 · 2 comments
Open

useDebounce如何对Button的单击事件做防抖? #2696

459319819 opened this issue Dec 7, 2024 · 2 comments

Comments

@459319819
Copy link

onClick每次点击都是一个新的值,如果缓存了,则点击失效,如果不缓存,则自动触发点击,进入无限循环

@GeoDaoyu
Copy link

show me the code

@danni-boii
Copy link

useDebounceFn 包裹住你的onClick function

https://ahooks.js.org/hooks/use-debounce-fn/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants