工作中解決問題記錄
peerDependencies
不在webpack打包
ERROR in 5.js?d011da16496c0f7f6327 from UglifyJs
Couldn't find preset "es2015" relative to directory
npm install babel-preset-es2015 --save-dev
nignx配置頭
**Webpack **
disableHostCheck: true,
historyApiFallback: true,
imgError( 頁面一直報錯)
onError=e=>{e.target.onError = null}
https://blog.csdn.net/qq_20282263/article/details/103809219
重新封裝Antd Input組件,解決中文輸入問題
onCompositionStart
git remote set-url origin https://coding.jd.com/CCMS-PRO/ccms-api-service.git
git push --all https://coding.jd.com/CCMS-PRO/ccms-api-service.git
配置二個重定向
location /testpass {
proxy_pass http://beta-oconsole.jd.com/testpass/example/console_beta;
}
location /api/ {
proxy_pass http://beta-oconsole.jd.com/api/;
}
修改提交信息
git commit --amend
as React.CSSProperties
color_picker: {
backgroundColor: "#fff",
padding: "10px",
position: "absolute",
top: 0,
zIndex: 1000
}
style={style.color_picker}
不能將類型“{ backgroundColor: string; padding: string; position: string; top: number; zIndex: number; }”分配給類型“CSSProperties”昌跌。
屬性“position”的類型不兼容夫凸。
不能將類型“string”分配給類型“Position | undefined”。ts(2322)
解決辦法
style={style.color_picker as React.CSSProperties}
不刷新頁面秋泄,新增URL參數(shù)
window.history.pushState({}, "My Profile", location.search + "&id=1")
.fatherrc.ts 配置為 esm: 'rollup',cjs: 'rollup'時報錯
https://github.com/umijs/father/issues/125
npm 出現(xiàn) Error: EPERM: operation not permitted, uv_cwd npm
重啟控制臺或關(guān)閉vscode
npm install模塊時 報錯:not such file or directory琐馆。
npm init -f
-f表示force的意思,不加這個恒序,npm會讓你輸入一堆信息瘦麸,比如name、version之類歧胁,如果只是做做實(shí)驗(yàn)小demo滋饲,直接-f,npm幫你初始化package.json喊巍,
再重新
Npm install