
React
Little_Pig_Bug
一只满身带着BUG,也要飞的猪猪侠
展开
-
Echarts绘制地图,且可以下钻到省区
echarts原创 2022-08-04 15:08:54 · 1728 阅读 · 0 评论 -
不能将类型“{ title: string; dataIndex: string; width: number; align: string;}分配给类型“(ColumnGroupType<any>“
antd表格中ts报错不能将类型“({ title: string; dataIndex: string; width: number; align?: undefined; render?: undefined; } | { title: string; width: number; align: string; render: (text: any, records: any) => Element; dataIndex?: undefined; })[]”分配给类型“(ColumnGr.原创 2021-09-26 15:15:35 · 7272 阅读 · 1 评论 -
Mac的录制屏幕和停止录制屏幕
1.录制屏幕,快捷键shif+command+5,出现如下图,选择录制屏幕2. 停止录制,control+command+esc或者直接电脑上方的触屏也有停止录屏的按钮原创 2021-03-10 16:07:16 · 22209 阅读 · 0 评论 -
macBook 解决端口被占用的问题
先上截图解决1. 先找到自己哪个端口号被占用,我的如上图是88522.lsof -i tcp:8852结果3.上图可知道我是PID是2283,执行命令kill -9 22834.重新启动项目,解决了。如果不想启动,可以先执行lsof -i tcp:8852,如果没出现上面2的截图,就代表端口占用已经解决了...原创 2021-03-08 09:36:06 · 633 阅读 · 0 评论 -
Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/@alicd‘
先上截图,遇到的问题开始我以为我没有代码权限,后来才知道node_modules文件夹操作没有权限解决问题sudo chmod 777 /usr/local/lib/node_modules结果截图感谢https://blog.youkuaiyun.com/shentian885/article/details/107376671/的提供解决方案~~~,只为记录下~...原创 2021-02-26 15:27:15 · 1151 阅读 · 2 评论 -
react添加水印
import React, { Component } from 'react';import request from '$src/services';import APIS from '$src/services/api';import { Toast } from 'antd-mobile';import './index.scss';export default class AppRoot extends Component { constructor(props) { s.原创 2020-06-15 15:55:51 · 941 阅读 · 0 评论 -
使用AntV F2实现仪表盘的例子
目前公司需要开发移动端图表项目,就选用了f2。目前没在官方实例里面找到罗盘的例子,就参考了G2的写了一个。import React, { Component } from 'react';import PropTypes from 'prop-types';import Immutable from 'immutable';import F2 from '@antv/f2';c...原创 2020-03-26 10:35:43 · 2322 阅读 · 0 评论 -
You may need an appropriate loader to handle this file type, currently no loaders are configured to
这是我在react项目中引入本地图片路径时候的报错解决方法1.npm i url-loader --save-dev ,安装成功会在package里面找到url-loader2. webpack.config.js添加以下代码以防不知道加在什么位置,下面是我整个module里面的设置module: { rules: [{ test: /\.j...原创 2019-12-19 10:54:45 · 5290 阅读 · 0 评论 -
react-dom.development.js:500 Warning: Can't perform a React state update on an unmounted component.
react-dom.development.js:500 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscript...原创 2019-12-06 15:21:46 · 2426 阅读 · 0 评论 -
webpack 4.0 打包去过滤console和ddebugger
之前使用vue的时候,过滤打包的使用的是uglifyjs-webpack-plugin这个插件,最近查资料发现这个插件被弃用了,使用terser-webpack-plugin。1.安装terser-webpack-plugin插件npm install terser-webpack-plugin --save-dev2.在webpack.config.js插入如下代码...原创 2019-12-06 14:53:12 · 1154 阅读 · 0 评论 -
针对同域名下cookie的获取和
比如我的domian是.wt.cainiao.com清空本地的cookie的代码exportfunctionclearAllCookie(){constdate=newDate();date.setTime(date.getTime()-10000);constkeys=document.cookie.match(/[^=;]+(?==)/g)...原创 2019-11-29 16:10:54 · 1499 阅读 · 0 评论 -
从零开始搭建React项目
1.首先确定自己安装了node,安装好了之后,npm也同样会有2.全局安装create-react-app,他是react的脚手架,其可以在本地安装react项目,命令pm install create-react-app -g3.新建自己第一个react项目 create-react-app 项目名称4.项目结构5.yarn start,项目启动...原创 2018-11-23 14:34:11 · 353 阅读 · 0 评论