1、foreach(推荐)
list.forEach((item)=>{ }); eg: dataSource.forEach((item) => { const est = item.estimateAmount === null ? 0 : parseFloat(item.estimateAmount); const gmv = item.estimateGmv === null ? 0 : parseFloat(item.estimateGmv); allCountBudget += est; allCountGmv += gmv; // allCountGmv = parseFloat(allCountGmv) + parseFloat(gmv); });
2、map(内部不支持计算逻辑?)
list.map((item, index)=> <div> {item.name} </div> ) )
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did222522