let data = [
{
title: "江苏",
key: "34fggg",
children: [
{
title: "苏州",
key: "sdf34",
children: [
{ title: "吴中", key: "rt3we" },
{ title: "姑苏", key: "34rff" },
{ title: "园区", key: "34gdf" }
]
},
{
title: "南京",
key: "8kgkk",
children: [
{ title: "鼓楼", key: "gdthj" },
]
},
{
title: "无锡",
key: "54y5y"
}
]
},
{
title: "浙江",
key: "94kr"
}
]
比如我知道‘吴中’的key是1-1-1
怎么获取‘苏州’的key
请看代码,利用递归和es6 some方法去遍历,如有帮助,望采纳