![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
文章平均质量分 59
Caiyun6666
代码使我快乐!
展开
-
React-Router --------- react-router-dom v6新特性使用
1.安装依赖npm i react-router-dom2.引入实现路由所需的组件,以及页面组件import { BrowserRouter, Routes, Route } from 'react-router-dom';import Foo from './Foo';import Bar from './Bar';function App(){ return ( <BrowserRouter> <Routes>转载 2022-01-26 16:50:38 · 959 阅读 · 0 评论 -
React Hooks + TypeScript + Ant Design -------------表单动态增减实现
官方地址:https://ant.design/components/form-cn/#components-form-demo-dynamic-form-item基础Demoimport { Form, Input, Button, Space } from 'antd';import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';const Demo = () => { const onFinish .原创 2021-08-12 11:03:10 · 569 阅读 · 0 评论 -
Dva + TypeScript + Redux -------------状态管理库的使用
1.约束store库,框定结构及属性名```javascriptexport interface ICurrentUser { character: string[]; name: string; phone: string; user_id: number;} export interface UserModelState { currentUser: ICurrentUser;}export interface UserModelType { namespace:原创 2021-01-05 18:28:54 · 622 阅读 · 0 评论 -
Umi Hooks------------useRequest的使用
useRequest作用:管理异步数据请求普通请求const { data, run, loading } = useRequest(getUsername, {manual: true})run : 手动触发data : 返回的数据loading :加载状态manual:直接更新datacancel :取消当前请求,如果有轮询,停止轮询 const { data, loading, run, cancel } = useRequest(getUsername, { poll原创 2021-01-05 17:17:31 · 5269 阅读 · 4 评论