摘要: 组件代码 import React from "react"; import { MyCardWrapper, MyCardHeader, MyCardMain } from "./styled"; interface IMyCard { children?: React.ReactNode; ti 阅读全文
posted @ 2022-04-19 17:50 爱放屁的菜鸟 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 目前在同一 git 下有三个个人练习的项目 koa-test、my-react-app、node-api,现想尝试用workspace 进行管理 第一步在根目录下 运行 yarn init 生成 package.json 文件(配置如下) { "name": "yarn-workspaces-exa 阅读全文
posted @ 2022-04-16 21:41 爱放屁的菜鸟 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 读取与修改的方法 const fs = require('fs'); // promisify 异步处理 const { promisify } = require('util'); const path = require('path'); const readFile = promisify(f 阅读全文
posted @ 2022-04-16 14:16 爱放屁的菜鸟 阅读(857) 评论(0) 推荐(0) 编辑
摘要: App.tsx import { useReducer } from 'react'; import { BrowserRouter, Switch } from 'react-router-dom'; import { renderRoutes } from 'react-router-confi 阅读全文
posted @ 2022-04-11 21:55 爱放屁的菜鸟 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 菜单数据结构 [ { "title": "首页", "icon": null, "path": "/home", "children": [] }, { "title": "Option", "icon": null, "path": "/home", "children": [ { "title" 阅读全文
posted @ 2022-03-30 12:36 爱放屁的菜鸟 阅读(2946) 评论(0) 推荐(0) 编辑
摘要: 第一步安装依赖 yarn add react-app-rewired customize-cra 第二步修改 package.json 配置,将 react-scripts 修改成 react-app-rewired "scripts": { "start": "react-app-rewired 阅读全文
posted @ 2022-03-22 17:38 爱放屁的菜鸟 阅读(878) 评论(0) 推荐(0) 编辑
摘要: 第一步安装依赖 yarn add http-proxy-middleware 第二步在 src 下创建 setupProxy.js 文件 const {createProxyMiddleware} = require('http-proxy-middleware'); module.exports 阅读全文
posted @ 2022-03-21 11:51 爱放屁的菜鸟 阅读(50) 评论(0) 推荐(1) 编辑
摘要: 第一步创建文件并初始化 yarn init 第二步安装依赖 yarn add express nodemon nodemon 用于热更新第三步创建功能文件 (bodyParser 已删除请忽略) common/index.js const fs = require('fs'); // promisi 阅读全文
posted @ 2022-03-21 11:47 爱放屁的菜鸟 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 第一步安装 react-router-config (需要注意不支持 react-router-dom 5以上的版本 ) yarn add react-router-config 第二步在 react-app-env.d.ts 中声明引入 /// <reference types="react-sc 阅读全文
posted @ 2022-03-10 18:14 爱放屁的菜鸟 阅读(1724) 评论(0) 推荐(0) 编辑
摘要: exportStatistics () { let usercode = getStorage('usercode') // url 为正常文件下载地址 return axios.get(`/hrssc/portal/plantform/prove/downloadPdf?typeId=0001&u 阅读全文
posted @ 2022-01-24 09:18 爱放屁的菜鸟 阅读(700) 评论(0) 推荐(0) 编辑