render(){
const{mobx}=this.props;
const itemList=[];
const items=mobx.itemBarcode;
console.log(items);
items.forEach((v,key)=>{
itemList.push([v.order,v.itemMsg,v.barcode,key])
});
console.log(itemList);
return (
<View style={styles.container}>
<Table borderStyle={{borderWidth: 0.5,borderColor: '#ccc'}}>
<Row data={TABLE_HEADER} flexArr={TABLE_FLEX} style={styles.tableHead} textStyle={styles.tableText}/>{
itemList.map((rowData,index,array)=>(
<TableWrapper key={index} style={styles.tableRow}>
{
rowData.map((cellData, cellIndex) => (
<Cell key={`${index}-${cellIndex}`} data={cellIndex === 2 ? this.dropCell(array[index][3]) : cellData} flex={TABLE_FLEX[cellIndex]} style={styles.tableHead} textStyle={styles.rowText}/>
)).filter((ftr,index,arr)=>{
return index<3;
})
}
</TableWrapper>
))
}
</Table>
</View>
);
}
rowData.map((cellData, cellIndex) => (
...代码...
)).filter((ftr,index,arr)=>{return index<3;})//筛选条件 取前三个值。