被问道了,当时只是简单设计了一下,type等都没加上,重新实现了一下。
效果
// 数据结构
nodes: [
{
label: 'title 1',
content: 'hello world',
children: [
{
label: 'title 1-1',
content: 'hello world content',
children: [
{
label: 'title 1-1-1',
content: 'hello world content',
children: []
},
{
label: 'title 1-1-2',
content: 'hello world content',
children: []
}
]
},
{
label: 'title 1-2',
content: 'hello world content',
children: [
{
label: 'title 1-2-1',
conten