![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ReactJs
WoodieWang
20岁,30年的开发经验,就问你怕不怕!
展开
-
Es6学习
Let、 var、 const使用let、var都可以定义变量,使用var定义的变量会成为全局变量;使用let不会。使用const定义变量为常量不能修改,相当为java中的const修饰的变量。字符串的使用新增加了几个方法includes():返回布尔值,表示是否找到了参数字符串。startsWith():返回布尔值,表示参数字符串是否在原字符串的头部。endsWith(...原创 2020-01-03 02:31:31 · 113 阅读 · 0 评论 -
React入门学习笔记
安装cnpm:npm install -g cnpm --registry=https://registry.npm.taobao.org安装yarn:cnpm install -g yarn 或者 npm install -g yarn搭建React开发环境的第一种方法(老-现在推荐):1、必须要安装nodejs 注意:安装nodejs稳定版本 教程中的n...原创 2019-12-30 14:49:17 · 98 阅读 · 0 评论 -
react生命周期函数
import React, { Component } from 'react';class Lifecycle extends Component { constructor(props) { console.log('01构造函数'); super(props); this.state = { msg:...原创 2019-12-26 18:48:44 · 70 阅读 · 0 评论 -
localstorage抽取成组件以及注意事项
var storage={ set(key, value){ localStorage.setItem(key, JSON.stringify(value)); }, get(key){ return JSON.parse(localStorage.getItem(key)); }, remove(key){ ...原创 2019-12-22 13:47:40 · 352 阅读 · 0 评论 -
练习:todolist、前端简单实现数据的增删、复选框重新渲染数据,并做localStorage持久化存储
import React, {Component} from 'react';class Todolist2 extends Component { constructor(props) { super(props); this.state = { list:[], }; } co...原创 2019-12-22 13:05:10 · 291 阅读 · 0 评论 -
input、select、checkbox、textarea表单的获取方式
import React, {Component} from 'react';class ReactForm extends Component { constructor(props) { super(props); this.state = { msg: "react表单", name: '...原创 2019-12-22 12:47:06 · 183 阅读 · 0 评论 -
react中使用switch-case
在周期中使用switch-caseswitch(num){ case "1":return 'a'; case "2":return 'b'; case "3":return 'c'; default:return 'd';}render中使用switch-caserender: inputMethod => ( <d...原创 2019-11-11 15:23:42 · 1482 阅读 · 1 评论 -
React实现数据模拟请求(mock+modal+page+util)
首先写一个根目录下创建一个uitl/request.js,用于发送请求request.js// import fetch from 'dva/fetch';function checkStatus(response) { if (response.status >= 200 && response.status < 300) { re...原创 2019-11-03 11:55:05 · 925 阅读 · 0 评论 -
React实现page层与model层分开写
EventList.js中的数据export default { // 命名空间,根据唯一的名字找到对应的数据 namespace: 'EventList', state: { data: [1, 2, 3], maxNum: 3 }, reducers : { // 定义一些函数 addNew...原创 2019-11-03 04:19:57 · 1960 阅读 · 0 评论 -
第一个react程序
import React, { Component } from 'react';// const 修饰的常量放在类的外面const t = () => "黑马程序员"class HelloWord extends Component { constructor(props) { super(props); this.state = { }...原创 2019-11-01 22:27:24 · 63 阅读 · 0 评论