1、外联js文件(RN自定义组件)
        module.exports=Header; 导出模块
        const Header=require('./header'); 导入外部js自定义组件()
    
        export default class Demo extends Component{}
        import Demo from './demo.js'
    
    2、遍历数组,添加事件
        show(title){
            alert(title);
        }
        render(){        
            var newsItem=[]
            for(var i in this.props.news){
                var text=(
                    <Text onPress={this.show.bind(this,this.props.news[i]}
                        numberOfLines={2}
                        sytle={sytle.news_item}
                        key={i}
                    >
                        {this.props.news[i]}
                    </Text>
                );
                newsItem.push(text);
            }
            
            return (
                {newsItem}
            );
        }

最新文章

  1. VC++ GDI 总结 一一 CBitmap类
  2. 浅析KMP算法
  3. 自定义弧形的 tabBar
  4. 《ArcGIS Engine+C#实例开发教程》第五讲 鹰眼的实现
  5. Oracle 12c最新特性
  6. C 语言---漂亮的宏定义
  7. C#学习日志 day 4 ------ 类相关---this指针以及相关关键字
  8. Fine Uploader 简单配置方法
  9. javascript学习笔记-2:jQuery中$(&quot;xx&quot;)返回值探究
  10. OpenStack_I版 5.Nova部署
  11. WPF样式中TargetType 属性 (Property) 和 x:Key 属性 (Attribute)
  12. English trip EM1 - PE2 My My name is... Teacher:Lamb Key: introduce myself
  13. Ajax常见面试题 -- 前端面试题(二)
  14. nginx log 错误502 upstream sent too big header while reading response header from upstream
  15. 【java8】慎用java8的foreach循环(作废)
  16. 【原创】MySQL CPU %sys高的案例分析(一)
  17. bzoj 3282
  18. 【第四周】psp
  19. SpringInAction--Spring Web应用之SpringMvc 注解配置
  20. Arduino学习笔记A6(补充) - 在串口读取多个字符串,并且转换为数字数组

热门文章

  1. Python股票量化第一步环境搭建
  2. 简易音乐播放器主界面设计 - .NET CORE(C#) WPF开发
  3. SWIG 3 中文手册——10. 参数处理
  4. JS中0.1+0.2!=0.3
  5. 牛客网剑指offer第13题——调整数组顺序使得奇数位于偶数前面
  6. .net core 3.0 swagger
  7. NODEJS 使用 sqlite3 本地文件数据库
  8. 谷歌更新后,chromedriver如何更换新版本
  9. WebApp开发-Zepto
  10. Spring BeanDefinitionHolder源码解析