uni-halo/tm-vuetify/tool/function/sleep.js
小莫唐尼 9d3ebac076 新增:更新halo.config.js 配置参数;
更新:更新项目UI框架;
修复:修复友链列表丢失白色背景色BUG;
2022-12-09 18:10:47 +08:00

17 lines
307 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 作者tmzdy
* 延时操作
* @param {Number} wait = [500] 延时
*/
function sleep(wait=500){
let timid = null;
if(wait==0) return Promise.resolve(true)
clearTimeout(timid);
return new Promise((res,rej)=>{
timid = setTimeout(function() {
res();
}, wait);
})
}
export default sleep;