[问与答] 请教 react 的 list 渲染问题

 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);

发表回复

您的电子邮箱地址不会被公开。