成就列表

This commit is contained in:
AncTe committed 2023-02-21 23:22:03 +08:00
1 parent 82c8434f9b
commit 9e51b03a4d
4 files changed
+102 -2

No files matched your search

+13 -1
View File
@@ -2,7 +2,7 @@
import { message } from 'ant-design-vue';
import { MessageApi } from 'ant-design-vue/lib/message';
import { isNil } from 'lodash';
import { Animation, TimingFn } from 'mutate-animate';
import { Animation, sleep, TimingFn } from 'mutate-animate';
import { ComputedRef, ref } from 'vue';
import { EVENT_KEY_CODE_MAP } from './keyCodes';
@@ -191,3 +191,15 @@ export function download(content: string, name: string) {
a.click();
document.body.removeChild(a);
}
/**
* 间隔一段时间调用一个函数
* @param funcs 函数列表
* @param interval 调用间隔
*/
export async function doByInterval(funcs: (() => void)[], interval: number) {
for await (const fn of funcs) {
await sleep(interval);
fn();
}
}