提高链接初始化速度
This commit is contained in:
@@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user