想请教一下大家
interface INode {
key: string;
value: string;
children: INode[];
}
[
{
key: '1',
value: 'xxx',
children: [
{
key: '11',
value: 'yyy',
children: [
{
key: '111',
value: 'zzz',
}
]
}
]
},
{
key: '2',
value: 'aaa',
children: [],
}
]
=>
{
'1': 'xxx',
'1-11': 'yyy',
'1-11-111': 'zzz',
'2': 'aaa'
}😭😭😭😭😭
全部评论
(2) 回帖