标准类别下拉树
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
function getTreeItem(tree, id){
|
||||
let result = {}
|
||||
tree.map(item => {
|
||||
if(item.id === id){
|
||||
result = item
|
||||
}else{
|
||||
if(item.children.length > 0){
|
||||
getTreeItem(item.children)
|
||||
}
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
export {
|
||||
getTreeItem
|
||||
}
|
||||
Reference in New Issue
Block a user