
发表日期: 2021-06-05 11:17:22 浏览次数:89
阿坝400电话办理【阿坝网站公司】阿坝百度优化、阿坝域名注册、阿坝网店美工、阿坝微信公众号托管

阿坝藏族羌族自治州,四川省辖自治州,紧邻成都平原,全州地表整体轮廓为典型高原,地势高亢,境内垂直气候显著;辖1县级市、12县,总面积84242平方公里;截至2019年末,阿坝州户籍人口89.93万人。
阿坝藏族羌族自治州境内有世界自然遗产九寨沟、黄龙及卧龙·四姑娘山大熊猫栖息地等世界级旅游景区。有马尔康卓克基土司官寨、松岗直波碉楼(含羌寨碉群)、松潘古城墙、壤塘棒托寺、错尔机寺、营盘山和姜维城遗址、日斯满巴碉房、阿坝州红军长征遗迹等全国重点文物保护单位。 [1]
2019年12月,国家民委命名阿坝藏族羌族自治州为“全国民族团结进步示范州”。 [2]
2020年阿坝州地区生产总值(GDP)突破400亿元,达411.75亿元,按可比价格计算,比上年增长3.3%。 [3]
第一种:通过将params放入对象作为该navigation.navigate函数的第二个参数,将params传递给路径:
this.props.navigation.navigate('RouteName', { / params go here / })第二种:通过将getParam传递
this.props.navigation.getParam(paramName, defaultValue)
HomeScreen主组件
class HomeScreen extends React.Component { render() { return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Home Screen1</Text> <Button title="Go to Details" onPress={() => this.props.navigation.navigate('Details',{ itemId: 86, otherParam: 'anything you want here', })}/> </View> ); }}DetailsScreen详情组件
接收参数我们用this.props属性
class DetailsScreen extends React.Component { render() { const { navigation } = this.props; const itemId = navigation.getParam('itemId', 'NO-ID'); const otherParam = navigation.getParam('otherParam', 'some default value'); return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Details Screen</Text> <Text>itemId: {JSON.stringify(itemId)}</Text> <Text>otherParam: {JSON.stringify(otherParam)}</Text> <Button title="Go to Details… again" onPress={() => this.props.navigation.push('Details', { itemId: Math.floor(Math.random() 100), }) } /> <Button title="Go to Home" onPress={() => this.props.navigation.navigate('Home')} /> <Button title="Go back" onPress={() => this.props.navigation.goBack()} /> </View>);}}通过打印我们看到下面的效果
结果如下

通过this.props.navigation.getParam动态修改当前的标题
DetailsScreen详情组件
class DetailsScreen extends React.Component { static navigationOptions = ({ navigation }) => { return { title: navigation.getParam('data', '默认值'), }; };render() { const { navigation } = this.props; const itemId = navigation.getParam('itemId', 'NO-ID'); const otherParam = navigation.getParam('otherParam', 'some default value'); console.log(itemId) console.log(otherParam) return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Details Screen</Text> <Text>Details Screen</Text> <Text>itemId: {JSON.stringify(itemId)}</Text> <Text>otherParam: {JSON.stringify(otherParam)}</Text> <Button title="Go to Details… again" onPress={() => this.props.navigation.push('Details', { itemId: Math.floor(Math.random() 100), })} /> <Button title="Update the title" onPress={() => this.props.navigation.setParams({data: '更新!'})} /> <Button title="Go to Home" onPress={() => this.props.navigation.navigate('Home')} /> <Button title="Go back" onPress={() => this.props.navigation.goBack()} /> </View> ); }}通过点击button 触发setParams来设置标题头为更新!
效果如下
服务热线
顶部
备案号: 苏ICP备11067224号
CopyRight © 2011 书生商友信息科技 All Right Reserved
24小时服务热线:400-111-6878 E-MAIL:1120768800@qq.com QQ:1120768800
网址: http://www.768800.com 网站建设:上往建站
关键词: 网站建设| 域名邮箱| 服务器空间| 网站推广| 上往建站| 网站制作| 网站设计| 域名注册| 网络营销| 网站维护|
企业邮箱| 虚拟主机| 网络建站| 网站服务| 网页设计| 网店美工设计| 网站定制| 企业建站| 网站设计制作| 网页制作公司|
400电话办理| 书生商友软件| 葬花网| 调温纤维| 海洋馆运营维护| 北京保安公司| 殡仪馆服务| 殡葬服务| 苏州殡葬一条龙| 朝阳殡葬| 苏州殡葬服务|
欢迎您免费咨询,请填写以下信息,我们收到后会尽快与您联系
服务热线:400-111-6878