07 2021 档案
摘要:无数据时得到错误的格式:false let values = { serviceTags: undefined, } let serviceTags = Array.isArray(values.se...
阅读全文
摘要:把img标签包裹在p标签里 let data = `` data = data.replace(//g, (word) => { if (word.includes('data-done="true"')) { ...
阅读全文
摘要:antd 对话框、上传图片、轮播图结合在一起 import React, { useState, useEffect, useRef } from 'react'import { Button, Upload, message, Modal, Carousel...
阅读全文
摘要:;[value[index - 1], value[index]] = [value[index], value[index - 1]]
阅读全文
摘要:解决方案: //生成cancelToken,用于取消请求const getCancelSource = () => { return axios.CancelToken.source()} //挂载时异步获取所属分类数据 useEffect(...
阅读全文
摘要:二级路由需要同样的配置: listDom.push() ...
阅读全文
摘要:forceRender setActiveKey(key)} className="m-tabs" centered type="card"> {getBaseInfoFiel...
阅读全文
摘要:config.js const baseURL = { // 使用反向代理解决跨域时,dev应为空字符串 dev: '', test: 'http://abc.cn', // 使用yarn build打包,所有接口使用这个url,需要服务器解决跨域 ...
阅读全文
摘要:const setAuth = () => (dispatch, getState) => { const router = getState().getIn(['light', 'router']).toJS() Api.light.testAuthSe...
阅读全文
摘要:const formatAuthData = ({ authData }) => { const find = (arr, parentId = '') => { for (let i = 0; i 0) { arr[i].id = `...
阅读全文
摘要:示例 component:.*\n.*\n.*,$ 删除对象中不要的属性及属性值
阅读全文
摘要:/** * @return {Boolean} */const filter = function (pathname, req) { return pathname.match('^/api') && req.method === 'GET';};co...
阅读全文
摘要:import React, { useState } from 'react'import { Cascader } from 'antd'import options from '../../utils/cities'export default f...
阅读全文
摘要:common.js: import axios from 'axios'import { message } from 'antd'import { baseURL } from '../utils/config'import qs from 'qs'imp...
阅读全文
摘要:import React, { useEffect, useState, useMemo } from 'react'import { Menu } from 'antd'import { connect } from 'react-redux'import ...
阅读全文
摘要:useHistory The useHistory hook gives you access to the history instance that you may use to navigate. import { useHistory } from ...
阅读全文
摘要:import React, { useState, useEffect } from 'react'import { EditorState, convertToRaw, ContentState, Modifier } from 'draft-js'impo...
阅读全文
摘要:import React from 'react'import { html2json, json2html } from 'html2json'export default function Index() { const data = ` ` c...
阅读全文
摘要:yarn add webpack-bundle-analyzer 修改webpack.config.js: const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')const isB...
阅读全文