
React
Start-ZJ
苦逼大学生,技术菜如狗,码力百分五。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
antd的异步加载树组件使用
import { TreeSelect } from 'antd';class Demo extends React.Component { state = { value: undefined, treeData: [ { id: 1, pId: 0, value: '1', title: 'Expand to load' }, { id: 2, ...原创 2020-03-14 10:37:50 · 6400 阅读 · 0 评论 -
React中的this为什么需要bind()来绑定(初步认识)
为什么要用bind等方法来绑定this?- 这是因为在实际使用的过程中,我们肯定是希望this指向的是触发dom事件的对象,但是由于组件本身是有一个渲染的过程的,实例函数都是由构造函数不断重新构造渲染的,所以就算一开始this指向的是触发时间的实例函数,但是在重新渲染的时候由于需要重新走一下构造函数,所以this所指的对象就会改变(应该是变为构造函数,或者是windows(也就是全局))所以我...原创 2019-11-19 09:29:14 · 1005 阅读 · 0 评论 -
React组件的生命周期(粗略)
Mountingconstructor()componentWillMount()render()componentDidMount()UpdatingcomponentWillReceiveProps()shouldComponentUpdate()componentWillUpdate()render()componentDidUpdate()Unmounting...原创 2019-11-15 09:40:37 · 151 阅读 · 0 评论 -
React的一些理解(部分)
React-优快云在元素集合中要用一个标签把所有的标签都包裹起来(通常用< div >…< /div >)。如果要给一个标签元素添加一个自定义属性的话用data-(XX)前缀,前缀可以自己起,data-是一定要的。jsx中可以使用js在React中使用css样式的话不要写class,用className,因为在es6中class是一个保留字,还有一个就是for要...原创 2019-11-04 19:47:08 · 249 阅读 · 0 评论