使用属性,定制组件
作者:
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>
);
}
}
本文标题:使用属性,定制组件
本文链接:https://www.haomeiwen.com/subject/gxemsttx.html
网友评论