
React
LPLIFE
学习接受学习
展开
-
react中的map遍历
constructor(props) { super(props); this.state = { list:[ 'learn react', 'learn english' ] } } render() { //jsx语法 return ( <div> ...原创 2018-11-13 23:27:49 · 20346 阅读 · 4 评论 -
React中的bind
作用:需要在事件处理程序中访问父组件,同样需要把该函数绑定到组件。如何将函数绑定到组件实例,可以使用以下几种方法:1.Constructor中绑定(ES2015)constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); }2.在Render中使用bind...原创 2018-11-13 23:56:17 · 2070 阅读 · 1 评论 -
react+webpack的小demo
搞学习!用react+webpack简单写了demo用到的知识点: map,props,state,flex布局,事件交互,fetch模拟后台请求,组件化开发,五星好评的巧妙写法可看动图:代码链接运行环境:我的话是: vscode+nodejs下载完后,执行进入根目录 : npm install 然后 npm start 就可以…...原创 2018-11-25 23:02:45 · 345 阅读 · 0 评论