react
酸菜鱼爱吃柠檬
要一直一直努力哦嘻嘻嘻
展开
-
React+Ts 声明事件
react 声明ts事件的时候 使用React的事件就行 比如 MouseEvent, SyntheticEvent等 <span onClick={(e: React.MouseEvent) => { e.stopPropagation() dispatch(deleteAcBaItemQc([baItem.baId])) }}>删除</span>SyntheticEvent是React的事件池 16.x和17.x的版本也有所不一样,详细的内容可原创 2021-12-31 12:01:00 · 1271 阅读 · 0 评论 -
if else/switch case/对象+自执行 关于条件判断的多种写法
第一种 keyif (strType === 'aa') { console.log('aa')} else if (strType === 'bb') { console.log('bb')} else if (strType === 'cc') { console.log('cc')} else if (strType === 'dd') { console.log('dd')} else if (strType === 'ee') { console.原创 2021-04-02 16:30:28 · 298 阅读 · 0 评论 -
使用CopperJs 实现在拍照上传裁剪功能
今天晚上写。。。谁割谁是王八蛋原创 2020-10-28 09:54:50 · 658 阅读 · 1 评论 -
react报错 Minified React error #152;
react编译后打包到oss上 程序某个页面白屏 报错信息如下:dabaopkg.chunk.js:2 Error: Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=a for the full message or use the non-minified dev environment for full errors and additional原创 2020-12-15 13:23:30 · 7069 阅读 · 1 评论 -
react修改state中的对象数组
react修改state中的对象数组一直把数据定义在store中没想过要把更改对象数组中的值,这次放在state中了突然发现还不知道怎么修改state中对象数组的某个对象的某个键值,解决之后先将实现方式来简单记录一下constructor() { super() this.state = { CopyList: [{personNum:'111'},{personNum:'222'},{personNum:'333'}], }}CopyList.map((v,index)=&原创 2020-12-11 16:43:26 · 5497 阅读 · 0 评论 -
常规报错记录
//报错Module build failed: Duplicate declaration "start"重复声明 start 这个变量 原因 使用const 时候没有注意到已经const 声明过 换成let或者换个名字就OK原创 2020-07-30 16:13:22 · 396 阅读 · 0 评论 -
react 中 button按钮的禁用和启用状态
react 中 button按钮的禁用和启用状态disabled 为false 是启用状态// 启用状态 const flags = true; <Button disabled={flags}/>disabled 为 true 是禁用状态// 禁用状态 <Button disabled/>// 禁用状态2 变量控制 const flags = false; <Button disabled={flags}/&g原创 2020-06-30 15:46:45 · 6790 阅读 · 0 评论 -
react动态修改样式。react中点击那个li 那个li加颜色和地边框
<div style={{display:this.state.searchHouFlag?'block':'none'}}> <StyleObj.SearchHouText> { searchHouList?searchHouList.map((item,index)=>( ...原创 2019-12-04 19:39:48 · 6550 阅读 · 0 评论 -
react中报错: There are multiple modules with names that only differ in casing.
There are multiple modules with names that only differ in casing.This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.Use equal casing. Compare these module i...原创 2019-11-29 09:23:55 · 753 阅读 · 0 评论