上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: 一款redux替代品的状态管理 实现: react状态管理 ts支持 数据持久化储存 store模块封装 三种引入使用的方法 清除全部或指定store内容 1、install npm install zustand # or yarn add zustand// 清除全部或指定store内容 时使用 阅读全文
posted @ 2023-03-02 09:19 王希有 阅读(730) 评论(0) 推荐(0) 编辑
摘要: // @ts-nocheck import React from 'react' class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { error: null, 阅读全文
posted @ 2023-02-10 14:45 王希有 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 官方: React.startTransition 不提供 isPending 的标志。要跟踪过渡的待定状态,请参阅 React.useTransition。 由于React.startTransition 不支持 跟踪pending状态,则示例使用hooks - useTransition 示例判 阅读全文
posted @ 2023-02-10 14:05 王希有 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 形如 const PRODUCTS = [ {category: 'Sporting Goods', price: '$49.99', stocked: true, name: 'Football'}, {category: 'Sporting Goods', price: '$9.99', sto 阅读全文
posted @ 2023-02-09 17:01 王希有 阅读(94) 评论(0) 推荐(0) 编辑
摘要: React 事件 1、React 事件的命名采用小驼峰式(camelCase),而不是纯小写。 2、使用 JSX 语法时你需要传入一个函数作为事件处理函数,而不是一个字符串。 3、在 React 中另一个不同点是你不能通过返回 false 的方式阻止默认行为。你必须显式的使用 preventDefa 阅读全文
posted @ 2023-02-09 13:38 王希有 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 1、官方参考 https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md 2、效果 安装 <= raact16 npm install react-virtualized --save >= react17 npm in 阅读全文
posted @ 2023-02-07 14:03 王希有 阅读(1631) 评论(0) 推荐(0) 编辑
摘要: 1、安装 $ npm install http-proxy-middleware --save$ # or$ yarn add http-proxy-middleware 2、创建 src/setupProxy.js (src目录下创建文件夹) const { createProxyMiddlewa 阅读全文
posted @ 2023-02-06 09:51 王希有 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: 1、下载 下载地址:https://github.com/coreybutler/nvm-windows/releases 2、安装 2.1、卸载已有的所有node等 2.2、安装路径最好是C:\nvm 2.3、下载完找到nvm的安装目录,打开setting.txt文件,添加上下面两个配置 node 阅读全文
posted @ 2023-01-09 16:46 王希有 阅读(91) 评论(0) 推荐(0) 编辑
摘要: "react": "^18.2.0", "antd": "^5.1.1", 先看效果(不选和多选) // 假设后端返回数据结构 const data = { fruit: [ { label: 'Apple', value: 'apple' }, { label: 'Pear', value: 'p 阅读全文
posted @ 2023-01-04 15:40 王希有 阅读(1357) 评论(0) 推荐(0) 编辑
摘要: 因react-router中路由配置时,子路由为父级路由+子路由拼接而成,故当实现面包屑时需要根据当前路由获取完整的父子路由链 入参:如 /layout/list/showList 出参:如 ['/layout', '/layout/list', '/layout/list/showList'] i 阅读全文
posted @ 2023-01-03 11:27 王希有 阅读(517) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页