美文网首页
使用属性,定制组件

使用属性,定制组件

作者: json_jie | 来源:发表于2016-08-17 11:38 被阅读14次
import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
   Text,
   View,
   Image,
} from 'react-native';

 class CoustomGreeting extends Component{
   render(){
     return(
       <Text style = {{backgroundColor:'white'}}>{this.props.name} Demo!             </Text>
      )
  }
}
class hello extends Component {
  render() {
    let pic = {uri:'https://facebook.github.io/react/img/logo_og.png'};
    return (
      <View style={styles.container}>
        <CoustomGreeting name='Rexxar' />
        <CoustomGreeting name='Jaina' />
        <CoustomGreeting name='Valeera' />
       </View>
    );
  }
}

相关文章

  • 使用属性,定制组件

  • React Native 04(初始React Native组件

    class / function 都可以是 "积木" (组件) 使用属性props定制"积木"(组件) defau...

  • React Native中的props、state

    属性 大多数组件在创建时就可以使用各种参数来进行定制。用于定制的这些参数就称为props(属性)。 原生组件的pr...

  • React Native 基础之 props, state,st

    Props(属性) 大多数组件在创建时就可以使用各种参数来进行定制。用于定制的这些参数就称为 props(属性)。...

  • React-Native学习笔记

    入门 Props属性 大多数组件在创建时就可以使用各种参数来进行定制。用于定制的这些参数就称为props(属性) ...

  • React Native - React Props(属性)

    Props(属性) 组件创建的时候需要用不同的参数进行定制,这些定制的参数就是props(属性),可为组件内部属性...

  • RN-Basic

    RN基础 Props(属性)/State(状态) 创建组件时 可以使用各种参数来进行定制, 用于定制的参数称为pr...

  • 学习React Native日记三,属性(Props)和状态(s

    属性 大多数组件在创建时就可以使用各种参数进行定制。这些参数即是属性。 Image组件为例 自定义组件为例 通过此...

  • Lesson11配置组件的props

    为了使得组件的可定制性更强,在使用组件的时候,可以在标签上加属性来传入配置参数。组件引用时添加自定义属性,都会被r...

  • RN之props属性

    大多数组件在创建时就可以使用各种参数来进行定制。用于定制的这些参数就称为props(属性)。以常见的基础组件Ima...

网友评论

      本文标题:使用属性,定制组件

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