export interface LeftBar {
expanded?: boolean;
name: string;
children?: LeftBar[];
}
const LeftBars:LeftBar[] = [
{
name: '系统账号',
children: [
{
name: '用户',
children: [],
},
{
name: '资源',
children: [],
},
],
},
];
const leftItems = LeftBars.map((lb) => {
<li>{lb.name}</li>;
});
console.log('LeftBars', LeftBars);
console.log('leftItems', leftItems);
1
sealingpp OP 这样写法有问题? 为何得到如此结果?
http://towncloud.sea8.top/index.php/s/9SiiHM9TfbNtNIn |
2
lalalaqwer 2022-09-05 23:08:37 +08:00
箭头函数带大括号要 return
|
3
westoy 2022-09-05 23:08:46 +08:00
map 里都没 return
{}里要显性 return 的啊 |
4
sealingpp OP |