假定现有树结构:
const personArr = [
{
id: "001",
name: "maimang",
children: [
{
id: "002",
name: "Tom",
headImg: "https://avatars1.githubusercontent.com/u/24405319?s=460&v=4"
},
{
id: "003",
name: "Jerry",
headImg: "https://avatars1.githubusercontent.com/u/24405319?s=460&v=4"
},
{
id: "006",
name: "业务部",
children: [
{
id: "007",
name: "小明",
headImg:
"https://avatars1.githubusercontent.com/u/24405319?s=460&v=4"
},
{
id: "008",
name: "小话",
headImg:
"https://avatars1.githubusercontent.com/u/24405319?s=460&v=4"
},