新增了多个静态图片资源文件,包括01.png、02.png等,并添加了相关的配置文件和组件,如vue.config.js、package.json等。同时引入了Tuniao UI库,并配置了相关的依赖和设置,以支持项目的开发和构建。
29 lines
525 B
JavaScript
29 lines
525 B
JavaScript
//防抖
|
|
export function debounceFun(func, delay=500) {
|
|
//定时器
|
|
let timer;
|
|
return function(...args) {
|
|
// 清除之前设置的定时器
|
|
clearTimeout(timer);
|
|
timer = setTimeout(() => {
|
|
func.apply(this, args);
|
|
}, delay);
|
|
};
|
|
}
|
|
|
|
//节流
|
|
export function throttleFun(func, delay=500) {
|
|
//定时器
|
|
let timer = null;
|
|
return function(...args) {
|
|
if(!timer){
|
|
timer = setTimeout(() => {
|
|
//执行前清空
|
|
timer = null;
|
|
console.log("执行了")
|
|
func.apply(this, args);
|
|
}, delay);
|
|
}
|
|
};
|
|
}
|