调整导航链接逻辑延时

This commit is contained in:
2021-05-23 23:35:33 +08:00
parent e007182608
commit ae94104f47

View File

@@ -47,7 +47,7 @@ let utils = {
console.warn('[出错的 obj]', obj); console.warn('[出错的 obj]', obj);
} }
// 删除自身 // 到达最后一项,删除 links 自身
if (index === (arr.length - 1)) { if (index === (arr.length - 1)) {
delete obj.links; delete obj.links;
} }
@@ -59,7 +59,7 @@ let utils = {
obj.sub.forEach(item => { obj.sub.forEach(item => {
setTimeout(() => { setTimeout(() => {
fn(item); fn(item);
}, 20 * currentIndex); }, 10 * currentIndex);
}); });
} }
}; };
@@ -82,12 +82,12 @@ let utils = {
// 写入缓存 // 写入缓存
setTimeout(() => { setTimeout(() => {
this.cache('W', navLinks); this.cache('W', navLinks);
}, 2 * currentIndex); }, 1000);
} }
// 同步 // 同步
currentIndexCpy = currentIndex; currentIndexCpy = currentIndex;
}, 1000); }, 5000);
return fn; return fn;
}, },