会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
爱放屁的菜鸟
博客园
首页
新随笔
联系
订阅
管理
2024年6月12日
uniapp vue3 实现自定义Switch效果
摘要: <template> <view class="container" @click="toggleSwitch"> <label :class="isOn ? 'switch-checked' : 'switch-nochecked'"> <view class="open">{{ activeTe
阅读全文
posted @ 2024-06-12 17:36 爱放屁的菜鸟
阅读(253)
评论(0)
推荐(0)
2022年4月19日
React 封装 Card 组件
摘要: 组件代码 import React from "react"; import { MyCardWrapper, MyCardHeader, MyCardMain } from "./styled"; interface IMyCard { children?: React.ReactNode; ti
阅读全文
posted @ 2022-04-19 17:50 爱放屁的菜鸟
阅读(538)
评论(0)
推荐(0)
2022年4月16日
yarn workspace 管理同一个 git 下的多个项目
摘要: 目前在同一 git 下有三个个人练习的项目 koa-test、my-react-app、node-api,现想尝试用workspace 进行管理 第一步在根目录下 运行 yarn init 生成 package.json 文件(配置如下) { "name": "yarn-workspaces-exa
阅读全文
posted @ 2022-04-16 21:41 爱放屁的菜鸟
阅读(328)
评论(0)
推荐(0)
node.js + express 实现 json 文件数据获取与更新
摘要: 读取与修改的方法 const fs = require('fs'); // promisify 异步处理 const { promisify } = require('util'); const path = require('path'); const readFile = promisify(f
阅读全文
posted @ 2022-04-16 14:16 爱放屁的菜鸟
阅读(987)
评论(0)
推荐(0)
2022年4月11日
React useContext + useReducer 实现 Hooks 状态管理功能
摘要: 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 爱放屁的菜鸟
阅读(169)
评论(0)
推荐(0)
2022年3月30日
React + antd (Menu组件渲染多级菜单)
摘要: 菜单数据结构 [ { "title": "首页", "icon": null, "path": "/home", "children": [] }, { "title": "Option", "icon": null, "path": "/home", "children": [ { "title"
阅读全文
posted @ 2022-03-30 12:36 爱放屁的菜鸟
阅读(3314)
评论(0)
推荐(0)
2022年3月22日
React 配置 @ 路径别名
摘要: 第一步安装依赖 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 爱放屁的菜鸟
阅读(917)
评论(0)
推荐(0)
2022年3月21日
react http-proxy-middleware 跨域处理
摘要: 第一步安装依赖 yarn add http-proxy-middleware 第二步在 src 下创建 setupProxy.js 文件 const {createProxyMiddleware} = require('http-proxy-middleware'); module.exports
阅读全文
posted @ 2022-03-21 11:51 爱放屁的菜鸟
阅读(71)
评论(0)
推荐(1)
node.js + express 完成登录接口功能
摘要: 第一步创建文件并初始化 yarn init 第二步安装依赖 yarn add express nodemon nodemon 用于热更新第三步创建功能文件 (bodyParser 已删除请忽略) common/index.js const fs = require('fs'); // promisi
阅读全文
posted @ 2022-03-21 11:47 爱放屁的菜鸟
阅读(486)
评论(0)
推荐(0)
2022年3月10日
react-router-config (嵌套路由)使用
摘要: 第一步安装 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 爱放屁的菜鸟
阅读(1873)
评论(0)
推荐(0)
下一页
公告