1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-11 12:49:30 +08:00
Files
uni-halo/tm-vuetify/tool/function/sleep.js
T
2022-12-06 15:08:29 +08:00

16 lines
265 B
JavaScript

/**
* 作者: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;