随笔分类 -  react

异步编程, promise, settimeout, async, await
摘要:promise 对于 settimeout:有状态控制,前后关系,避免复杂的回调 async, await对于 promise:多个promise之间的编排,注意是编排,具体实现还是promise promise.all对于 promise无顺序关系的编排 promise和JavaScript同级m 阅读全文

posted @ 2022-05-18 06:13 Kooing 阅读(41) 评论(0) 推荐(0)

react 项目分析
摘要:1,功能反应到最后的按钮上,但按钮,模块, 页面都是component 2,router的问题上,url就是一个router的state,router对应的url决定了跳转那个页面(控件),当我们使用navigate的跳转的时候,发现不是全部刷新(旧方法直接跳转到具体的html文件) 3,状态: 组 阅读全文

posted @ 2022-05-15 06:33 Kooing 阅读(59) 评论(0) 推荐(0)

分析css,flex布局
摘要:1,管理系统的flex布局,ant-layout 控制大布局,连写has-sider改变direction-row 2,原图,flex:auto,帮助扩展剩下的,display;flex帮助下面的用flex:auto扩展,所以display和block差不多,但有flex:auto帮助他吃完,说到底 阅读全文

posted @ 2022-05-13 06:02 Kooing 阅读(31) 评论(0) 推荐(0)

js解构复制语法
摘要:let a = { person:{ name:"ken", tall:180 } } let {person} = a const [x,y] = [11,12] let a, b, rest; [a, b] = [10, 20]; console.log(a); // expected outp 阅读全文

posted @ 2022-05-08 07:58 Kooing 阅读(77) 评论(0) 推荐(0)

箭头函数
摘要:1,弄清调用call或声明,f 是声明,f()是调用 2,万一函数是带参数的,像回调函数,他们会自己给你安排parameter,可以写在外面 这个赋值,我们不调用,回调会调用 onClick={go} 这是定义const go = (item ) => { navigate(item.key) }; 阅读全文

posted @ 2022-05-04 15:13 Kooing 阅读(49) 评论(0) 推荐(0)

管理后台项目
摘要:1, item.children.length>0?,item.children.length是空的,item.children?.length>0? 2, 数组可以是“”,但不可以是“ ” 3, 对象类似数组的取值 4,setState原理是新的state和旧的state比较,所以在原 state 阅读全文

posted @ 2022-05-03 15:45 Kooing 阅读(74) 评论(0) 推荐(0)

json server问题
摘要:tsc.ps1 cannot be loaded because running scripts is disabled on this system” Code Answer’s 被权限限定了 阅读全文

posted @ 2022-05-03 05:26 Kooing 阅读(31) 评论(0) 推荐(0)

css
摘要:1,https://sjxi.cn/detil/e1c7039735204b488dfcfebef4e5ed89css选择器:后面盒子大小100%会被前面的限制 连写=与&&,逗号=或||,空格=从属关系 2,容器分为100%和真实内容超过了标签大小会强行伸出来,然后后面标签内容跟上, overfl 阅读全文

posted @ 2022-05-01 14:58 Kooing 阅读(44) 评论(0) 推荐(0)

imutable
摘要:1, 设置成imutable,state下有的子节点没有更新,可以用shouldidUpdate控制 2,state状态是多层的时候,主要是用来深拷贝的 阅读全文

posted @ 2022-04-29 10:40 Kooing 阅读(46) 评论(0) 推荐(0)

redux
摘要:分为发消息,dispatch 订阅和回调,subscribe 消息中心store, 准则 state以单一对象存在store中, state不能再store中修改,用组件的setState,个能返回一些信息 用reducer帮助 一个处理逻辑,store像一个容器 有异步问题,比如请求接口还没有回来 阅读全文

posted @ 2022-04-28 13:57 Kooing 阅读(30) 评论(0) 推荐(0)

react-router
摘要:1,路由包 npm i react-router-dom@5 2, 子路由 react的编程式 改名 提供路由 跨域问题:浏览器只接受同域名的数据,但代理服务器可以接受其他服务器数据, 所以你要负载均衡,还是跨域,都要找代理服务器nginx,通过监听的端口+api(path)可以帮你代理,如果没有命 阅读全文

posted @ 2022-04-28 09:15 Kooing 阅读(32) 评论(0) 推荐(0)

react-hook
摘要:1,hooks-usestate,加状态 2,hooks-useEffect,可以用很多个useEffect,像生命周期,加状态改变了调用useEffect 3,useCallback, 没有依赖的时候,会缓存,不会重写刷新,useMemo也差不多,返回一个函数(计算复杂结果)缓存 4,useRef 阅读全文

posted @ 2022-04-27 14:48 Kooing 阅读(30) 评论(0) 推荐(0)

前端学习
摘要:1,node_modules third part library2, app component basic component3, babel 把jsx转成js4, hot module reloading 热更新5, index.html 全部开始页面, app是react开始的6, <rea 阅读全文

posted @ 2022-04-25 07:07 Kooing 阅读(45) 评论(0) 推荐(0)

json服务器
摘要:json服务器 阅读全文

posted @ 2022-04-24 06:42 Kooing 阅读(30) 评论(0) 推荐(0)

导航