手写数据
dataArray: [
{
state: 0,
data: [
{text: 'xxxxxxxxxxx工作1', num: '1'},
{text: 'xxxxxxxxxxx工作2', num: '1'},
],
}
],
在render写入
{
this.state.clickType ?
<View>
{this.state.dataArray.map((item,index)=>{ //第一层循环
if(item.state == 0){
return (
<View>{
item.data.map((li,_index)=>{ //第二层循环
return (
<TouchableOpacity
onPress={()=>this.nextClick(li)}
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingRight: px2dp(30),
backgroundColor: '#fff',
}}>
<View style={styles.secondLevel}>
<Feather
name={'corner-down-right'}
size={FONT_SIZE(20)}
color='#A6A6A6'
/>
<Text numberOfLines={1} style={styles.s_txt}>{li.text}</Text>
</View>
<Text style={styles.num}>{li.num}</Text>
</TouchableOpacity>
)
})}</View>
)
}
})}
</View> : null
}