mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 13:19:31 +08:00
v1.0.0-beta 源码正式开源
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 作者:tmzdy
|
||||
* 延时操作
|
||||
* @param {Number} wait = [500] 延时
|
||||
*/
|
||||
function sleep(wait=500){
|
||||
let timid = null;
|
||||
clearTimeout(timid);
|
||||
return new Promise((res,rej)=>{
|
||||
timid = setTimeout(function() {
|
||||
res();
|
||||
}, wait);
|
||||
})
|
||||
}
|
||||
|
||||
export default sleep;
|
||||
Reference in New Issue
Block a user