
reactjs
w799766
这个作者很懒,什么都没留下…
展开
-
react基础——生命周期方法
1、装载过程:constructor getDefaultProps getInitialState componentWillMount render componentDidMount2、更新过程componentWillReceiveProps shouldComponentUpdate componentWillUpdate render componen...原创 2018-08-29 19:27:23 · 272 阅读 · 0 评论 -
react中阻止事件冒泡
直接看栗子: 页面上3个div,如图所示 1、在没有涉及到原生事件注册只有react事件时,用e.stopPropagation()阻止冒泡,代码如下:import React, { Component } from 'react';import './App.css';class App extends Component { handleClickTestBox = (...原创 2018-09-10 16:13:08 · 28396 阅读 · 2 评论