mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 05:09:29 +08:00
9d3ebac076
更新:更新项目UI框架; 修复:修复友链列表丢失白色背景色BUG;
17 lines
307 B
JavaScript
17 lines
307 B
JavaScript
/**
|
|
* 作者: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; |