ReactNative:学习props的使用
来源:互联网 发布:wps可以在mac上用吗 编辑:程序博客网 时间:2024/06/06 03:37
学习props的使用
/index.android.js
import React, { Component} from 'react';import { AppRegistry, Text, Image, View} from 'react-native';class Greeting extends Component { render() { // let pic = { // uri: this.props.mypic // }; return ( <View> <Image source={{uri: this.props.mypic}} style={{width: 193, height: 110}}/> <Text > 标题:{this.props.name} < /Text> </View> ); }}class LotsOfGreetings extends Component { render() { return ( <View style={{alignItems: 'center'}}> <Greeting name='Rexxar' mypic='https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg' /> <Greeting name='Jaina' mypic='https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'/> <Greeting name='Valeera' mypic='https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'/> </View> ); }}//注册组件(包名,组件名);AppRegistry.registerComponent('HelloWorldApp', () => LotsOfGreetings);
0 0
- ReactNative:学习props的使用
- ReactNative学习十三-Props和State
- ReactNative学习之Props(属性)
- reactNative学习笔记之Props属性
- ReactNative中 ...this.other与...this.props的区别
- ReactNative基础---Components and Props
- 使用props的一个基本原则
- react使用props的原则
- ReactNative入门之props与state
- vue中component组件的props使用
- [ReactNative]ReactNative学习资源整合
- ReactNative Demo - Dimensions 的使用
- ReactNative学习
- reactNative学习
- reactNative学习
- 学习ReactNative
- 【ReactNative】undefined is not an object(evaluating 'this.props.navigator')
- VS的.props工程属性文件的使用
- laravel 按条件分页
- 5.代理模式
- UDP编程补充——UDP广播程序的实现
- 音频相关
- 静态内部类的一些认识---->单例模式
- ReactNative:学习props的使用
- Java线程(Thread)调度
- JAVA基础总结-2 字符类
- android developer tiny share-20160905
- 设计模式 - 状态模式
- 运行python脚本的几种方法
- 数据库坏块的部分还原
- 数据库路由中间件MyCat
- 查看线上日志利器less