2018年7月25日
摘要: 前言 参考了很多文章,结合实例写下我自己的理解 react中component生命周期主要分为三个阶段:加载、更新和卸载 1、加载(Mounting) 主要包含4个方法 constructor(),componentWillMount(),render()和componentDidMount() 2 阅读全文
posted @ 2018-07-25 17:19 hero、 阅读(450) 评论(0) 推荐(0)
摘要: 1、进入到项目目录下 cd downloads/test/react-app 2、安装依赖包 npm install 3、启动项目 npm start 注:start后可能会报一些错误,只需要看到缺少了哪些依赖包,然后执行命令(如我这缺少query-string) npm install query 阅读全文
posted @ 2018-07-25 14:00 hero、 阅读(858) 评论(0) 推荐(0)
摘要: 1、进入到项目目录下 cd downloads/test/react-app 2、安装依赖包 npm install 3、启动项目 npm start 注:start后可能会报一些错误,只需要看到缺少了哪些依赖包,然后执行命令(如我这缺少query-string) npm install query 阅读全文
posted @ 2018-07-25 13:58 hero、 阅读(149) 评论(0) 推荐(0)