随笔分类 - react
在移动端语言react中使用video.js
摘要:在video.js基础上封装了一个reactVideo弹窗组件 npm install video.js --save 首先npm 安装video.js 1 //ReactVideo.tsx 2 import React, { Component, Fragment } from 'react';
阅读全文
react表单
摘要://首先简单介绍受控组件,每个都要去change事件触发 import React from 'react' class Form extends React.Component { constructor(props) { super(props); this.state = { username
阅读全文
react从入门到熟悉(回顾react)
摘要:首先npm和node环境就不说了,不懂得参考我写的vue2.0安装,里面有npm和node安装的介绍react开发参考官网创建react项目搭建开发环境,安装的是最新版npx create-react-app my-app(这个是项目名称)安装完成后cd my-app 直接npm run start
阅读全文
react生命周期
摘要:图是百度来的 图有一处错误componentWillReceiveProps图上是错的 1 componentWillMount:在组件渲染之前执行2 componentDidMount:在组件渲染之后执行3 shouldComponentUpdate :返回true和false,true代表允许改
阅读全文
react事件处理条件渲染列表循环
摘要: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
阅读全文
react-router-dom
摘要:先说概念 react-router: 实现了路由的核心功能 react-router-dom: 基于react-router,加入了在浏览器运行环境下的一些功能,例如:Link组件,会渲染一个a标签,Link组件源码a标签行; BrowserRouter和HashRouter组件,前者使用pushS
阅读全文
react todoList小demo
摘要:基于create-react-app做的小demo 比较简单直接上代码 效果图
阅读全文
react项目基本搭建
摘要:使用的是create-react-app@3.1.1版本首先安装 npm install create-react-app -g然后创建文件 create-react-app react-test进入文件cd react-test运行npm run eject让文件吧webpack相关配置暴露出来,
阅读全文
react从简到难(一)
摘要:react脚手架搭建 1先建一个文件夹如:react-cli-basic2 npm init 创建page.json文件 回车就好 文件夹就多了一个page.json 3 react必须装的插件react react-dom babelify babel-preset-es2015 babel-pr
阅读全文