// 递归算法找usedept对应名称
traverseCodeToName(treelist, udCode) {
if (!treelist) {
return;
}
for (let index = 0; index < treelist.length; index++) {
if (treelist[index].code == udCode) {
this.travUdNameTemp = treelist[index].name;
return;
}
if (treelist[index].children != undefined && treelist[index].children.length > 0) {
this.traverseCodeToName(treelist[index].children, udCode);
}
}
},
js递归树
猜你喜欢
转载自blog.csdn.net/xueyue616/article/details/83826508
今日推荐
周排行