React-Native的绑定this
来源:互联网 发布:http请求返回json数据 编辑:程序博客网 时间:2024/04/27 20:08
- http://www.jianshu.com/p/2733fb656083
- 1,绑定this,不传参
export default class Nearby extends Component{ static defaultProps={ name:'111' } render(){ return( <View style={styles.containerStyle}> <Text style={styles.textStyle} onPress={this.Click}>Home</Text> </View> ); } Click = () =>{ console.log(this.props.name) }}
- 2,绑定this,传参
export default class Nearby extends Component{ static defaultProps={ name:'111' } render(){ return( <View style={styles.containerStyle}> <Text style={styles.textStyle} onPress={()=>this.Click('222')}>Home</Text> </View> ); } Click = (name) =>{ console.log(this.props.name) }}
0 0
- React Native 的绑定 this
- React-Native的绑定this
- React Native 的绑定 this
- React Native 的绑定 this
- React Native的this.props获取属性
- 【React Native】常见的函数绑定方法
- React绑定this的三种方式
- react函数绑定this的方式。
- 【React Native】React Native之Navigator has been remove from this package...的问题
- react native -- this.props.children
- React-Native中this的带给大家的困惑
- react native 代参bind this 的两种方式
- react native开发基础=JavaScript= this的用法
- react native 代参bind this 的两种方式
- react-native react 中的bind(this)
- React事件处理函数中绑定this的bind()函数
- 【REACT NATIVE 系列教程之三】函数绑定与FLEXBOX是用好REACT的基础
- 【REACT NATIVE 系列教程之三】函数绑定与FLEXBOX是用好REACT的基础
- 究竟啥才是互联网架构“高可用”
- 最新github创建blog主页
- 程序员技术练级攻略
- C语言
- gradle中用到的命令行
- React-Native的绑定this
- 恢复输入框的内容
- Unity5-ABSystem(四):AssetBundle依赖
- hadoop入门(一)
- 如何学好C++语言
- com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authent
- DML触发器触发顺序
- Java常用面试题18 列出目录或者文件
- Javascript 对象值与null undefined和空字符串