06 2021 档案

摘要:common.js: common函数传递的参数添加 contentType: 'application/x-www-form-urlencoded' 即可改变post请求参数传递的格式 import axios from 'axios'import qs f... 阅读全文
posted @ 2021-06-30 09:30 徐同保 阅读(916) 评论(0) 推荐(0) 编辑
摘要:decodeURIComponent encodeURIComponent 参考链接:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/encode... 阅读全文
posted @ 2021-06-25 17:15 徐同保 阅读(48) 评论(0) 推荐(0) 编辑
摘要:使用 ReactDOM.createPortal,类似于vue的Teleport import React from 'react'import ReactDOM from 'react-dom'import { Spin } from 'ant... 阅读全文
posted @ 2021-06-22 11:39 徐同保 阅读(387) 评论(0) 推荐(0) 编辑
摘要:Document 阅读全文
posted @ 2021-06-17 18:31 徐同保 阅读(66) 评论(0) 推荐(0) 编辑
摘要:// #region 商户列表 companySearch: (data) => common({ url: urls.light.companySearch, data, method: 'post' }), companyAdd: (data) =... 阅读全文
posted @ 2021-06-16 10:45 徐同保 阅读(47) 评论(0) 推荐(0) 编辑
摘要:在scripts/start.js文件,注释掉openBrowser(urls.localUrlForBrowser)即可 阅读全文
posted @ 2021-06-15 16:03 徐同保 阅读(308) 评论(0) 推荐(0) 编辑
摘要:查看有哪些版本: npm view compression-webpack-plugin versions 安装旧版本: yarn add compression-webpack-plugin@5 修改webpack.config.js文件: const Co... 阅读全文
posted @ 2021-06-15 15:54 徐同保 阅读(376) 评论(0) 推荐(0) 编辑
摘要:安装: yarn add webpackbar 修改webpack.config.js文件: const WebpackBar = require('webpackbar')plugins: [ // ... new webpack.ProgressPlu... 阅读全文
posted @ 2021-06-15 15:06 徐同保 阅读(130) 评论(0) 推荐(0) 编辑
摘要:{ "script": { "build": "cross-env GENERATE_SOURCEMAP=false node scripts/build.js" }} 阅读全文
posted @ 2021-06-15 12:48 徐同保 阅读(179) 评论(0) 推荐(0) 编辑
摘要:装包: yarn add cross-env 配置: "start": "cross-env PORT=3030 node scripts/start.js", 阅读全文
posted @ 2021-06-15 12:40 徐同保 阅读(202) 评论(0) 推荐(0) 编辑
摘要:{ "homepage": "/edu/"} 或者: 需要安装 cross-env: yarn add cross-env { "script": { "build": "cross-env PUBLIC_URL=/edu/ node scripts... 阅读全文
posted @ 2021-06-15 12:04 徐同保 阅读(293) 评论(0) 推荐(0) 编辑
摘要:以及父组件控制子组件的input框获取焦点 父组件: import React, { useRef, useEffect } from 'react'import FancyInput from './FancyInput'export default fun... 阅读全文
posted @ 2021-06-10 19:10 徐同保 阅读(2856) 评论(0) 推荐(0) 编辑
摘要:点击按钮focus到某个输入框 import React, { useRef, useEffect } from 'react'export default function TextInputWithFocusButton() { const inputE... 阅读全文
posted @ 2021-06-10 18:59 徐同保 阅读(635) 评论(0) 推荐(0) 编辑
摘要:import React, { useState } from 'react'export default function Test() { const [state, setState] = useState({ username: 'a... 阅读全文
posted @ 2021-06-10 18:29 徐同保 阅读(431) 评论(0) 推荐(0) 编辑
摘要:// 文件注释中 禁用、启用、配置规则(在文件最顶部添加)/* eslint-disable *//* eslint-enable *//* eslint eqeqeq: 0, curly: 2 */// 单独给某行js代码关闭eslint检测,如下:// e... 阅读全文
posted @ 2021-06-10 14:41 徐同保 阅读(905) 评论(0) 推荐(0) 编辑
摘要:使用useMemo优化性能: import React, { Suspense, useMemo } from 'react'import { Switch, Route } from 'react-router-dom'import { connect } ... 阅读全文
posted @ 2021-06-10 12:50 徐同保 阅读(395) 评论(0) 推荐(0) 编辑
摘要:useEffect第二个参数可以是普通类型、也可以是引用类型。 如果是从props接收来的值,是引用类型的,且是immutable类型的,不要在mapStateToProps里使用toJS,如下: const mapStateToProps = (state)... 阅读全文
posted @ 2021-06-10 12:04 徐同保 阅读(2849) 评论(0) 推荐(0) 编辑
摘要:1.安装Chrome插件(Postman Interceptor) 2.postman配置 参考链接:https://learning.postman.com/docs/sending-req... 阅读全文
posted @ 2021-06-08 18:46 徐同保 阅读(535) 评论(0) 推荐(0) 编辑
摘要:react antd组件阻止事件冒泡: e.domEvent.stopPropagation()}> handleEdit(item.id)}> ... 阅读全文
posted @ 2021-06-04 15:36 徐同保 阅读(548) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示