原创 webpack 4.0 打包去過濾console和ddebugger

之前使用vue的時候,過濾打包的使用的是uglifyjs-webpack-plugin這個插件,最近查資料發現這個插件被棄用了,使用 terser-webpack-plugin。 1. 安裝terser-webpack-plugin插件

原创 使用AntV F2實現儀表盤的例子

  目前公司需要開發移動端圖表項目,就選用了f2。目前沒在官方實例裏面找到羅盤的例子,就參考了G2的寫了一個。 import React, { Component } from 'react'; import PropTypes fro

原创 react添加水印

import React, { Component } from 'react'; import request from '$src/services'; import APIS from '$src/services/api'; i

原创 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,

原创 針對同域名下cookie的獲取和

比如我的domian是.wt.cainiao.com 清空本地的cookie的代碼 export function clearAllCookie() {   const date = new Date();   date.setTime

原创 vscode設置快捷鍵,使得sctrl+s自動修復eslint的問題

   "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, 關閉vscode,重啓項目,打開有eslint的問題,比如換行,缺少分號等,ctrl+s可以自動修

原创 Object.prototype.toString.call(),instanceof,typeof,Array.isArray()

1.Object.prototype.toString.call() 可以判斷任何類型,包括對null,undefined的判斷 2.instanceof instanceof 的內部機制是通過判斷對象的原型鏈中是不是能找到類型的 pr

原创 npm run build打包過程中解決eslint導致打包終止的問題

打包前執行命令 npm run lint-fix ,然後再執行npm run build即可。 在我們pakage.json裏面找到如下 後來查找資料發現,npm run lint-fix 可以修改代碼樣式,就不會報ESLint錯誤了。

原创 window.open新打開同一個窗口,每次打開同一個窗口

原文鏈接:https://www.cnblogs.com/liumengdie/p/7918601.html   一、保留當前頁面,打開一個新的tab頁面 (1)方法一:利用超鏈接 超鏈接<a

原创 谷歌瀏覽器怎麼看到http版本

按f12,刷新頁面,重新發送請求,找到Network--->Response Headers--->view source

原创 [Vue warn]: Failed to mount component: template or render function not defined.

首先問題定位在我引入的兩個組件AddDialog,EditDialog上面,這兩個組件的目錄結構如下 其中我要在我的父組件timeConfig引入上面兩個字組件,我的代碼引入如下 import AddDialog from './ad

原创 element-ui 時間的格式化

之前格式化一直用自己寫的格式化方式,也看到過安裝moment,都感覺挺麻煩的,看到過element-ui的format,但是今天才知道這個用法,value-format="HH:mm:ss",年月日的自動前面添加前綴。

原创 ['1', '2', '3'].map(parseInt)

出處:https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/4 parseInt parseInt() 函數解析一個字符串參數,並返回一個指定基數的整數

原创 Vscode拉取代碼報錯‘git:remote:HTTP Basic:Access denied’

Vscode拉取代碼報錯‘git:remote:HTTP Bacic:Access denied’,IDEA報錯'Authentication failed for 'XXX.git/'' 在我IDEA拉取後臺代碼,前端vscode提交代

原创 map,forEach,some,filter條件過濾的介紹

1.map let arr = [1,2,3,4,5] let newarr =arr.map(item=>{ arr.push(10) return item*2 })