02 2024 档案
摘要:1.类组件生命周期 以下是 React 类组件的全部生命周期方法,按照调用顺序排列: constructor(props) 用途:组件的构造函数,在组件实例化时调用,用于初始化状态和绑定方法。 static getDerivedStateFromProps(props, state) 用途:在组件实
阅读全文
摘要:1.类组件 import Taro from '@tarojs/taro'; import { Component,useState } from 'react' class Classtest extends Component { constructor(props) { super(props
阅读全文
摘要:eslint根据eslint配置文件的parserOption,知道了要使用babel对代码进行解析,但是解析babel需要使用babel配置文件,由于找不到配置文件(babel配置文件默认需要放在根目录下),所以会报错。因此,添加requireConfigFile: false,本质上是告诉esl
阅读全文
摘要:1.查询当前镜像 // 1. 清空缓存 npm cache clean --force // 2. 切换新源 npm config set registry https://registry.npmmirror.com3.查看镜像npm config get registry4.查看完整的 npm
阅读全文