亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

react循環遍歷

react循環遍歷

荼酒 2016-05-30 11:18:55
<div> <table> <thead> <tr> <th>編號</th> <th>姓名</th> <th>年齡</th> </tr> </thead> <tbody?id="listinfo"> </tbody> </table> </div> var?arr?=?[ { id:'1001' ,name:'張三' ,age:'20' } ,{ id:'1002' ,name:'李四' ,age:'21' } ]; var?Ids??=?React.createClass({ render:function(){ return( <tr>{ React.Children.map(this.props.children,function(child){ return?<td>{child}</td>; }) } </tr> ); } });? ReactDOM.render( <Ids> <span>{arr[0].id}</span> <span>{arr[0].name}</span> <span>{arr[0].age}</span> </Ids>, document.getElementById('listinfo') ); </script>問題: 這樣只顯示第一個對象的屬性, 如何將所有對象的屬性都遍歷出來?
查看完整描述

1 回答

  • 1 回答
  • 1 關注
  • 5047 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號