
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 Sep 5, 2022 箭头函数带大括号要 return |
3 westoy Sep 5, 2022 map 里都没 return {}里要显性 return 的啊 |
4 sealingpp OP |