随笔分类 -  react

摘要:安装 npm i react-router-dom -- save<Router basename="/admin"> <Route path="/" exact component={()=>{<div>首页</div>}}> <Route path="/about" exact componen 阅读全文
posted @ 2020-04-28 19:58 学习。。。 阅读(244) 评论(0) 推荐(0)
摘要:生命周期的三个状态 mounting : 组件插入到dom updating: 将数据更新到dom unmounting:将组件移除dom 生命周期的钩子函数 ComponentWillMount: 组件将要渲染 ajax ComponentDidMount:组件渲染完毕 添加动画 Componen 阅读全文
posted @ 2020-04-27 14:34 学习。。。 阅读(118) 评论(0) 推荐(0)
摘要:一 基础 props: 父传子 单向 import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; class ParentCom extends React.Component { constr 阅读全文
posted @ 2020-04-23 15:28 学习。。。 阅读(130) 评论(0) 推荐(0)
摘要:一,组件 import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; // 函数式组件 return function Hello(props) { let titleName = <p> 这是 阅读全文
posted @ 2020-04-22 19:38 学习。。。 阅读(158) 评论(0) 推荐(0)
摘要:一,react 特点 1. 声明式设计 2.虚拟dom 3.jsx 4.组件化,模块化 5.单向数据流 二,脚手架 Create React App npm i -g create-react-app create-react-app --version create-react-app 项目名称 阅读全文
posted @ 2020-04-22 15:40 学习。。。 阅读(174) 评论(0) 推荐(0)