提高链接初始化速度

This commit is contained in:
2021-06-04 23:05:56 +08:00
parent ac6bb8723f
commit 3f0d9e0abc

View File

@@ -33,13 +33,13 @@ let utils = {
// 有链接 // 有链接
if (obj.links != undefined) { if (obj.links != undefined) {
// 无子路径 // 无子分类
if (obj.sub === undefined) { if (obj.sub === undefined) {
obj.sub = []; obj.sub = [];
} }
obj.links.forEach((item, index, arr) => { obj.links.forEach((item, index, arr) => {
// 添加到子路径(适配 Element UI - Tree // 添加到子分类(适配 Element UI - Tree
try { try {
obj.sub.push(item); obj.sub.push(item);
} catch (err) { } catch (err) {
@@ -59,7 +59,7 @@ let utils = {
obj.sub.forEach(item => { obj.sub.forEach(item => {
setTimeout(() => { setTimeout(() => {
fn(item); fn(item);
}, 10 * currentIndex); }, 2 * currentIndex);
}); });
} }