上一页 1 ··· 7 8 9 10 11
摘要: 官网参考地址: https://reactrouter.com/web/example/basic 基础用法: import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom"; <Router> <div 阅读全文
posted @ 2020-11-06 08:21 老胡Andy 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 安装: npm install axios --save 新建TUAPI.js import axios from 'axios'; export const TUAPI = axios.create({ baseURL: process.env.REACT_APP_BASE_URL, respon 阅读全文
posted @ 2020-11-03 21:40 老胡Andy 阅读(234) 评论(0) 推荐(0) 编辑
摘要: ExpressJS常用中间件: npm install cookie-parser --save npm install body-parser --save npm install compression --save npm install errorhandler --save npm ins 阅读全文
posted @ 2020-11-03 21:39 老胡Andy 阅读(320) 评论(0) 推荐(0) 编辑
摘要: react-app-rewired的作用是在不eject的情况下修改webpack配置 目标:修改build的output目录 1: npm install react-app-rewired --save-dev 2: 根目录下新建文件:config-overrides.js 3:添加以下配置 m 阅读全文
posted @ 2020-11-03 21:35 老胡Andy 阅读(5454) 评论(0) 推荐(0) 编辑
摘要: 使用--typescript参数新建React项目 create-react-app react-ts-demo --template typescript 新建Header.tsx文件,加入以下代码: import React, { FC } from 'react'; interface MyP 阅读全文
posted @ 2020-11-03 16:59 老胡Andy 阅读(1386) 评论(2) 推荐(1) 编辑
上一页 1 ··· 7 8 9 10 11