如何呈现反应中的对象数组?
https:/plnkr.co/EDIT/X9Ov5roJtTSk9YhqYUdp?P=预览
class First extends React.Component { constructor (props){ super(props); } render() { const data =[{"name":"test1"},{"name":"test2"}]; const listItems = data.map((d) => <li key={d.name}>{d.name}</li>; return ( <div> hello </div> ); }}
回首忆惘然
相关分类