标签:doc ntb numbers number get return element dom document
var numbers = [1,2,3,4,5,6,7,8,9];
ReactDom.render({
<ul>
{
numbers.map(function(item){
return <li>{item}</li>
})
}
</ul>,
document.getElementById(‘app‘)
})
利用React遍历数组,并且用数组的元素生成<li>arrItem</li>标签组
标签:doc ntb numbers number get return element dom document
原文地址:http://www.cnblogs.com/lantuoxie/p/6923183.html