上一页 1 2 3 4 5 6 7 ··· 15 下一页
  2020年5月31日
摘要: //首先简单介绍受控组件,每个都要去change事件触发 import React from 'react' class Form extends React.Component { constructor(props) { super(props); this.state = { username 阅读全文
posted @ 2020-05-31 22:26 执候 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 首先npm和node环境就不说了,不懂得参考我写的vue2.0安装,里面有npm和node安装的介绍react开发参考官网创建react项目搭建开发环境,安装的是最新版npx create-react-app my-app(这个是项目名称)安装完成后cd my-app 直接npm run start 阅读全文
posted @ 2020-05-31 10:40 执候 阅读(272) 评论(0) 推荐(0) 编辑
  2020年5月24日
摘要: 图是百度来的 图有一处错误componentWillReceiveProps图上是错的 1 componentWillMount:在组件渲染之前执行2 componentDidMount:在组件渲染之后执行3 shouldComponentUpdate :返回true和false,true代表允许改 阅读全文
posted @ 2020-05-24 23:23 执候 阅读(151) 评论(0) 推荐(0) 编辑
  2020年4月12日
摘要: 1条件判断与渲染 1 class ParentCom extends React.Component{ 2 constructor(props){ 3 super(props) 4 this.state = { 5 isLogin:true 6 } 7 } 8 render(){ 9 if(this 阅读全文
posted @ 2020-04-12 12:13 执候 阅读(766) 评论(0) 推荐(0) 编辑
  2019年12月8日
摘要: 先说概念 react-router: 实现了路由的核心功能 react-router-dom: 基于react-router,加入了在浏览器运行环境下的一些功能,例如:Link组件,会渲染一个a标签,Link组件源码a标签行; BrowserRouter和HashRouter组件,前者使用pushS 阅读全文
posted @ 2019-12-08 17:06 执候 阅读(929) 评论(0) 推荐(0) 编辑
  2019年12月7日
摘要: 基于create-react-app做的小demo 比较简单直接上代码 效果图 阅读全文
posted @ 2019-12-07 17:26 执候 阅读(216) 评论(0) 推荐(0) 编辑
  2019年11月20日
摘要: 使用的是create-react-app@3.1.1版本首先安装 npm install create-react-app -g然后创建文件 create-react-app react-test进入文件cd react-test运行npm run eject让文件吧webpack相关配置暴露出来, 阅读全文
posted @ 2019-11-20 15:21 执候 阅读(1226) 评论(0) 推荐(0) 编辑
  2019年9月20日
摘要: react脚手架搭建 1先建一个文件夹如:react-cli-basic2 npm init 创建page.json文件 回车就好 文件夹就多了一个page.json 3 react必须装的插件react react-dom babelify babel-preset-es2015 babel-pr 阅读全文
posted @ 2019-09-20 11:23 执候 阅读(414) 评论(0) 推荐(0) 编辑
  2019年7月16日
摘要: 没做处理之前的打包 首先第一步 优化resolve.modules配置 build->webpack.base.config.js 优化前写法 优化后 'src':resolve('src'), 'node_modules': resolve('node_modules'), var src = p 阅读全文
posted @ 2019-07-16 15:31 执候 阅读(236) 评论(0) 推荐(0) 编辑
  2019年5月24日
摘要: 随着正则用的越来越普遍,今天正好有时间整理一下 https://baike.baidu.com/item/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/1700215?fr=aladdinhttps://deerchao.cn/tutorials/reg 阅读全文
posted @ 2019-05-24 10:09 执候 阅读(321) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 15 下一页