赞
踩
dataArr=[[{},{},{}],[],[],[],]
<List className="tbBox"> <Flex className="title"> {data.map(item => ( <Flex.Item key={item.title} style={item.width?{width:'25%',flex:'none'}:null}//动态style样式 > {item.title} </Flex.Item> ))} </Flex> //双层循环写法 {dataArr.map((arr,indArr)=>(//双层循环---外层 <Flex key={`wc${indArr}`} onClick={(e)=>{this.onRowClick(indArr,e)}}> {dataArr[0].map((item,index) => (//双层循环--内层 <Flex.Item key={`nc${item.title}${index}`} style={item.width?{width:'25%',flex:'none'}:null}> { item.component==='InputItem'? <InputItem placeholder="请输入" keyName={`${item.keyName}&${indArr}`} form = {this.props.form} onBlur={this.onBlur} rules={item.rules} type={item.type} onChange = {this.onChange} initialValue={item.value} /> :(item.component==='Picker'? <Picker keyName={`${item.keyName}&${indArr}`} placeholder="请选择" data={item.data} rules={item.rules} form = {this.props.form} onChange = {this.onChange} initialValue={item.value} /> :(item.component==='InputModal'? <InputModal keyName={`${item.keyName}&${indArr}`} placeholder="请输入" data={item.data} rules={item.rules} onChange = {this.onChange} form = {this.props.form} initialValue={item.value} /> :null)) } </Flex.Item> ))} </Flex> ))} </List>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。