美文网首页
ES遍历语法

ES遍历语法

作者: 1234yws | 来源:发表于2018-10-16 16:35 被阅读13次
[].map(()=>{
})
{this.state.dataSource.map((dataSource,index)=> {
                return(
                    <View style = {styles.view1}>
                      <TouchableHighlight style = {styles.view1}
                      color = "black"
                      onPress={() => Alert.alert('点击了录播图' + index)}
                      //点击后的背景颜色 
                      underlayColor="#1FB579" 
                      >
                      <Text>{dataSource.title}</Text>

                      </TouchableHighlight>

                   </View> 
              );
        })}

相关文章

网友评论

      本文标题:ES遍历语法

      本文链接:https://www.haomeiwen.com/subject/fdbhzftx.html