const routes = [
{
title: '首页',
},
{
title: '黑板',
subs: [
{
title: '黑板报',
display: false,
},
],
},
{
title: '场景方案',
subs: [
{
title: '场景',
subs: [
{
title: '场景初始化',
},
],
},
{
title: '方案',
},
],
},
]
遍历当前树形结构导出 <p>{title}</p>
推荐看看:使用递归遍历并转换树形数据(以 TypeScript 为例),挺详细的。