会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
徐同保
web前端行业的小学生
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
47
48
49
50
51
52
53
54
55
···
88
下一页
2021年6月16日
添加注释 使扁平的代码可以折叠
摘要: // #region 商户列表 companySearch: (data) => common({ url: urls.light.companySearch, data, method: 'post' }), companyAdd: (data) =...
阅读全文
posted @ 2021-06-16 10:45 徐同保
阅读(54)
评论(0)
推荐(0)
2021年6月15日
create-react-app 关闭自动开启浏览器配置
摘要: 在scripts/start.js文件,注释掉openBrowser(urls.localUrlForBrowser)即可
阅读全文
posted @ 2021-06-15 16:03 徐同保
阅读(315)
评论(0)
推荐(0)
create-react-app 打包开启 gzip 压缩
摘要: 查看有哪些版本: npm view compression-webpack-plugin versions 安装旧版本: yarn add compression-webpack-plugin@5 修改webpack.config.js文件: const Co...
阅读全文
posted @ 2021-06-15 15:54 徐同保
阅读(399)
评论(0)
推荐(0)
create-react-app 编译进度条配置
摘要: 安装: yarn add webpackbar 修改webpack.config.js文件: const WebpackBar = require('webpackbar')plugins: [ // ... new webpack.ProgressPlu...
阅读全文
posted @ 2021-06-15 15:06 徐同保
阅读(135)
评论(0)
推荐(0)
create-react-app 生产环境去除sourcemap
摘要: { "script": { "build": "cross-env GENERATE_SOURCEMAP=false node scripts/build.js" }}
阅读全文
posted @ 2021-06-15 12:48 徐同保
阅读(183)
评论(0)
推荐(0)
通过cross-env改变create-react-app默认启动端口号
摘要: 装包: yarn add cross-env 配置: "start": "cross-env PORT=3030 node scripts/start.js",
阅读全文
posted @ 2021-06-15 12:40 徐同保
阅读(209)
评论(0)
推荐(0)
create-react-app 修改 webpack output.publicPath
摘要: { "homepage": "/edu/"} 或者: 需要安装 cross-env: yarn add cross-env { "script": { "build": "cross-env PUBLIC_URL=/edu/ node scripts...
阅读全文
posted @ 2021-06-15 12:04 徐同保
阅读(307)
评论(0)
推荐(0)
2021年6月10日
React Hooks 父组件调用子组件的方法
摘要: 以及父组件控制子组件的input框获取焦点 父组件: import React, { useRef, useEffect } from 'react'import FancyInput from './FancyInput'export default fun...
阅读全文
posted @ 2021-06-10 19:10 徐同保
阅读(2894)
评论(0)
推荐(0)
React Hooks 进入页面以后自动 focus 到某个输入框
摘要: 点击按钮focus到某个输入框 import React, { useRef, useEffect } from 'react'export default function TextInputWithFocusButton() { const inputE...
阅读全文
posted @ 2021-06-10 18:59 徐同保
阅读(643)
评论(0)
推荐(0)
react hooks 太多的useState 显得很冗余,有没有什么规整的方法呢?
摘要: import React, { useState } from 'react'export default function Test() { const [state, setState] = useState({ username: 'a...
阅读全文
posted @ 2021-06-10 18:29 徐同保
阅读(436)
评论(0)
推荐(0)
上一页
1
···
47
48
49
50
51
52
53
54
55
···
88
下一页
公告