摘要: 1. 使用 globalContext 进行生产消费。非父子间通信 阅读全文
posted @ 2022-08-11 23:25 zzzzzyyyyyy 阅读(23) 评论(0) 推荐(0)
摘要: react的思想:无必要勿增实体 1. ref 使用 myRef = React.createRef() <input ref={this.myRef}></input> 2. setState 如果setState处在异步中,那么里面的setState是同步执行, 如果setState处在同步中, 阅读全文
posted @ 2022-07-28 23:56 zzzzzyyyyyy 阅读(68) 评论(0) 推荐(0)
摘要: 1. 在class类中,定义方法在constructor里面和外面的区别?? 定义在constructor里面是原型方法,定义在外边是实例方法。 里面的原型方法在new的时候会改变this指向 2. 在class中定义方法不用 function关键字 阅读全文
posted @ 2022-07-27 22:31 zzzzzyyyyyy 阅读(62) 评论(0) 推荐(0)
摘要: 主要使用红框中的内容 import React, { Component } from 'react' export default class app extends Component { value = 1 add = () => { console.log(this.value); this 阅读全文
posted @ 2022-07-27 22:29 zzzzzyyyyyy 阅读(25) 评论(0) 推荐(0)
摘要: 创建项目报错: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1). We no longer support global installation of Create React 阅读全文
posted @ 2022-07-24 21:57 zzzzzyyyyyy 阅读(235) 评论(1) 推荐(1)
摘要: baseUrl 改为 ‘/api’ 阅读全文
posted @ 2022-02-24 10:53 zzzzzyyyyyy 阅读(74) 评论(0) 推荐(0)
摘要: parseTime(time, cFormat) { if (arguments.length 0) { return null } const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' let date if (typeof time 'objec 阅读全文
posted @ 2021-12-26 18:06 zzzzzyyyyyy 阅读(254) 评论(0) 推荐(0)
摘要: rimraf node_modele 阅读全文
posted @ 2021-12-22 10:18 zzzzzyyyyyy 阅读(117) 评论(0) 推荐(0)
摘要: 执行 git remote update origin 命令,刷新远程分支 阅读全文
posted @ 2021-11-18 17:50 zzzzzyyyyyy 阅读(279) 评论(0) 推荐(0)
摘要: 打开cmd, 输入如下命令 npm config set registry https://registry.npm.taobao.org 判断是否配置淘宝镜像成功 npm config get registry npm info express 阅读全文
posted @ 2021-08-27 00:06 zzzzzyyyyyy 阅读(170) 评论(0) 推荐(0)