const tree = [
{
key: '1',
title: '1',
children: [
{
key: '1-1',
title: '1-1',
children: []
},
{
key: '1-2',
title: '1-2',
children: []
},
]
},
{
key: '2',
title: '2',
children: [
{
key: '2-1',
title: '2-1',
children: []
},
{
key: '2-2',
title: '2-2',
children: [
{
key: '2-2-1',
title: '2-2-1',
children: []
}
]
},
]
}
];
// copy一个新树
const copyTree = (node) => {
树形结构寻找父节点
最新推荐文章于 2024-06-19 08:45:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)