排名
7
文章
192
粉丝
15
评论
16
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

前言
什么是防抖与节流暂时先不说了,我这里直接先记录一下
- //定义一个过期的定时器
- let timer = setTimeout(function () {
-
- }, 0);
- //防抖函数
- const debounce = (func,time) => {
- if (timer) {
- clearTimeout(timer);
- timer = setTimeout(function () {
- func();
- }, time);
- }
- }
-
-
- //调用
- debounce(async () => {
- const resultData = await postUrl('jobManager/CronRead', {}, { cron: cron }).finally(() => {
- })
- console.log("我请求了接口")
- methods.setValue("CronNotes", resultData.data)
- },500)
评价