- 博客(87)
- 收藏
- 关注

原创 Webpack的基础使用和简单优化
webpack是一个用于现代 JavaScript 应用程序的静态模块打包工具。当 webpack 处理应用程序时,它会在内部构建一个依赖图(dependency graph),此依赖图对应映射到项目所需的每个模块,并生成一个或多个bundle。为什么要使用webpack1. 与react一类模块化开发的框架搭配着用比较好。2. 属于配置型的构建工具,比较用容易上手。3. webpack使用内存来对构建内容进行缓存,构建过程中会比较快webpack的核心概念1. ..
2021-09-03 16:51:43
569
原创 修改LDAP密码后,代码无法上传的原因
最近刚结束了来新公司最忙的一段时间,整理下开发过程中遇到的各种小问题吧,想到多少写多少吧。。。。。。废话少说,先上第一个。公司的git账号是用LADP账户登陆的,然后自己中途修改了密码,提交代码就显示了上面一大串,而去一旦自己写代码和账号,上面的就会被无限刷,压根操作不了。然后人家就给我提供了下面的方法:1. maccd ~/Library/Application Supportrm -rf .cdn.user.data.json2. window全局搜索.cdn.u...
2021-12-27 15:29:52
549
原创 不能将类型“{ 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
7237
1
原创 不能将类型“XXX“分配给类型“IntrinsicAttributes & IntrinsicClassAttributes<PieChart> & Readonly<{}> & Reado“
警告如下
2021-06-16 15:33:03
12125
1
原创 Mac的录制屏幕和停止录制屏幕
1.录制屏幕,快捷键shif+command+5,出现如下图,选择录制屏幕2. 停止录制,control+command+esc或者直接电脑上方的触屏也有停止录屏的按钮
2021-03-10 16:07:16
21947
原创 macBook 解决端口被占用的问题
先上截图解决1. 先找到自己哪个端口号被占用,我的如上图是88522.lsof -i tcp:8852结果3.上图可知道我是PID是2283,执行命令kill -9 22834.重新启动项目,解决了。如果不想启动,可以先执行lsof -i tcp:8852,如果没出现上面2的截图,就代表端口占用已经解决了...
2021-03-08 09:36:06
622
原创 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
1145
2
原创 深克隆 js
lodash const oa={a:1};const ob =_.cloneDeep(oa);oa.c= 1;oa // {a:1,c:1};ob // {a:1}; JSON.parse(JSON.stringify(target)) const oa={a:1};const ob =JSON.parse(JSON.stringify(oa));oa.c= 1;oa // {a:1,c:1};ob // {a:1};
2021-01-05 16:55:50
159
原创 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
926
原创 vscode设置快捷键,使得sctrl+s自动修复eslint的问题
"editor.codeActionsOnSave": { "source.fixAll.eslint": true},关闭vscode,重启项目,打开有eslint的问题,比如换行,缺少分号等,ctrl+s可以自动修复啦
2020-03-31 17:01:57
2236
1
原创 使用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
2305
原创 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
5250
原创 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
2420
原创 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
1148
原创 针对同域名下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
1494
原创 npm run build打包过程中解决eslint导致打包终止的问题
打包前执行命令npm run lint-fix,然后再执行npm run build即可。在我们pakage.json里面找到如下后来查找资料发现,npm run lint-fix可以修改代码样式,就不会报ESLint错误了。...
2019-10-22 13:35:42
8987
转载 window.open新打开同一个窗口,每次打开同一个窗口
一、保留当前页面,打开一个新的tab页面(1)方法一:利用超链接超链接<a href="http://www.cnblogs.com/liumengdie/" title="我的博客" target="_blank">Welcome</a>(2)方法二:利用js打开新页面(在另外新建窗口中打开窗口)window.open("http://www.cnb...
2019-09-24 10:30:21
6218
原创 谷歌浏览器怎么看到http版本
按f12,刷新页面,重新发送请求,找到Network--->Response Headers--->view source
2019-09-23 13:31:26
17936
8
原创 [Vue warn]: Failed to mount component: template or render function not defined.
首先问题定位在我引入的两个组件AddDialog,EditDialog上面,这两个组件的目录结构如下其中我要在我的父组件timeConfig引入上面两个字组件,我的代码引入如下import AddDialog from './addDialog/index'import EditDialog from './editDialog/index'正确的写法应该如下:impor...
2019-08-22 20:20:03
455
原创 element-ui 时间的格式化
之前格式化一直用自己写的格式化方式,也看到过安装moment,都感觉挺麻烦的,看到过element-ui的format,但是今天才知道这个用法,value-format="HH:mm:ss",年月日的自动前面添加前缀。...
2019-08-01 13:54:33
1148
转载 ['1', '2', '3'].map(parseInt)
出处:https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/4parseIntparseInt()函数解析一个字符串参数,并返回一个指定基数的整数 (数学系统的基础)。const intValue = parseInt(string[, radix]);string要被解析的值。如果参数不是一...
2019-07-08 13:46:51
1181
原创 Vscode拉取代码报错‘git:remote:HTTP Basic:Access denied’
Vscode拉取代码报错‘git:remote:HTTP Bacic:Access denied’,IDEA报错'Authentication failed for 'XXX.git/''在我IDEA拉取后台代码,前端vscode提交代码时,就取代码报错‘git:remote:HTTP Basic:Acess denied’,IDEA报错'Authentication failed for '...
2019-07-02 10:33:37
8521
1
原创 不在以下 request 合法域名列表中,请参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/networ
最近又重新新拿起了小程序,接触到了uni-app,在写的过程中,遇到的问题挺多的,也说明了自己真的好久没有好好的学习了,先上图吧"https://unidemo.dcloud.net.cn 不在以下 request 合法域名列表中,请参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/netwo...
2019-04-25 14:39:08
10032
4
原创 map,forEach,some,filter条件过滤的介绍
1.map let arr = [1,2,3,4,5] let newarr =arr.map(item=>{ arr.push(10) return item*2 }) console.log(arr) //[1, 2, 3, 4, 5,10,10,10,10,10] console.log(newarr) ...
2019-03-20 15:38:58
2707
原创 关于webpack配置的一些简单说明
1.exclude/include{ test:/\.(js|jsx)$/, exclude:/node_modules/, use: { loader: "babel-loader" }},{ test: /\.js$/, loader: 'babel-loader', include: [resolve('src'...
2019-03-14 15:34:20
427
原创 Object.prototype.toString.call(),instanceof,typeof,Array.isArray()
1.Object.prototype.toString.call()可以判断任何类型,包括对null,undefined的判断2.instanceofinstanceof 的内部机制是通过判断对象的原型链中是不是能找到类型的 prototype,能在实例上找到的类型[1,3] instanceof Object //true[1,3] instanceof Array ...
2019-03-13 19:35:52
738
原创 element Pagination切换分页条数,会出现两次请求
场景:分页条数分别是20/50/100条,默认20条的时候,一共有83页,100条的时候,一共有17条数据。当我点到83页查看页面数据,页面的请求是pgSize: 20,pgNum: 83当我切换到100条的时候,页面出现了两次数据查询,其实我页面就写了一次请求。后来分析,我觉得应该是element自己的问题,当我从20切换100的时候,其实页面已经没有了84页了,但是此时页面...
2019-03-11 21:09:53
4212
1
原创 vue实时获取页面的宽度,自适应屏幕
data(){ return{ fullWidth:document.documentElement.clientWidth } }, created(){ window.addEventListener('resize', this.handleResize) }, beforeDe...
2019-03-11 20:37:55
26317
1
原创 数组去重
es6var arr = [1,3,43,2,1,3,43]Array.from(new Set(arr)) //[1, 3, 43, 2]基本的let arg = [1,1,2,3,4,4,5] let newArr = []for(let i in arg){ //indexOf if(newArr.indexOf(arg[i])<0){ ...
2019-03-08 15:41:17
208
原创 setTimeout实现setinterval
var count= 0;var intervalTime = 1000;var intervalId = null;function timeOutFun(){ count++; console.log("timeOutFun——"+count); if(executeTimes<5){ setTimeout(arguments.callee...
2019-03-08 11:02:28
276
原创 获取浏览器的地址
1.获取http协议:window.location.protocol2.获取一个页面的主机名和端口号相当于是hostname和port:window.location.host所以浏览器的地址是window.location.protocol+'//'+window.location.host...
2019-03-07 16:49:58
1945
原创 小程序&前端项目缓存解决方案 转至元数据结尾
小程序篇 背景: 在开发小程序的时候遇到本次发布的更新在用户的手机微信客户端上显示的还是老板本的项目,导致了用户不能使用,必须要在工作人员的引导下清除微信缓存货刷掉小程序的进程才能够正常使用.本来我们开发小程序的目的是为了让用户更快的使用我们产品减少对员工的依赖,但是此次遇到的缓存问题不能降低我们使用成本反而加大了工作人员的不便. 在过后根据讨论以及取经得出了一下...
2019-01-10 17:18:20
1158
原创 从零开始搭建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
348
转载 setTimeout和Promise,对macrotasks(宏任务),microtasks(微任务)的理解
console.log(1);setTimeout(function(){ console.log(2);}, 0);Promise.resolve().then(function(){ console.log(3);}).then(function(){ console.log(4);});console.log(5);结果:1,5,3,4,2javascrip...
2018-11-14 15:28:52
783
原创 ES6常用的语法
一.数组的扩展1.pushconst arr = ['1','2']const arr1 = ['3']//常用arr.push(arr1) arr // ['1','2','3']//es6arr.push(...arr1)arr // ['1','2','3'] 2.concatconst arr = ['1','2']con...
2018-10-31 16:36:40
308
原创 vue 实现全屏和退出全屏的功能
<span class="icon-contain" @click="getFullCreeen"> <svg-icon icon-class="quanping" /></span>JSexport default { name:'topHeader', data(){ return{ ..
2018-10-29 14:32:20
10219
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人