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: []
}
]
},
]
}
]
// 添加子节点
const addNext = (key, node) => {
树形结构添加子节点
最新推荐文章于 2024-04-17 16:21:59 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)