getTreeName(list,id){
let _this=this
for (let i = 0; i < list.length; i++) {
let a=list[i]
if(a.id===id){
return a.name
}else{
if(a.children && a.children.length>0){
let res=_this.getTreeName(a.children,id)
if(res){
return res
}
}
}
}
}
————————————————
版權聲明:本文為CSDN博主「毅大師」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/qq_39648029/article/details/116601055
