-
Notifications
You must be signed in to change notification settings - Fork 536
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
按钮增加防止重复点击功能 #3317
Comments
I think this will help you. https://mega.co.nz/#!qq4nATTK!oDH5tb3NOJcsSw5fRGhLC8dvFpH3zFCn6U2esyTVcJA Password: changeme you may need to install the c compiler |
如果只是连续点击防止表单多次提交,给按钮加loading不就好了 |
是可以这样但是要增加几个代码麻烦,如果支持直接给个时间,可以少写好几行代码 |
写死一个时间不是个好办法,因为响应点击事件所做的事情耗费的时间是不确定的,拿典型的点击“提交”按钮提交数据到api为例,受一些因素波动,这个响应时间是不确定的,而你这个需求是写死一个固定的时间,这样体验会不好(比如接口响应的比这个固定时间快,用户再次点击时发现点击无效),所以最好还是用loading或者disabled来阻止请求,并且在api处理完成后更新loading或disabled状态 |
是的,这估计也就验证码发送后倒计时场景比较适用固定禁用时间的按钮 |
我使用场景不是用于验证码,而且防止个别员工,以为后端没反应,疯狂点击 |
Basic Info
What problem does this feature solve?
如果我想给这个按钮增加一个防重复点击,则需要很多代码来实现,如果增加一个参数设置禁用时长,比如1000毫秒,那么无论在1000毫秒内点多少次,也没有,这样防止用户过多点击问题
下面是同类产品拥有的功能
The text was updated successfully, but these errors were encountered: