06 2021 档案
摘要:简单记录一下 Notifications 里面使用到的 CSSMotionList 的一段代码。 先看下面代码片段,Notification.add()当,notice 的数量超过最大数量时,Antd 是把第一个的 key 借给最新插入的这个 notice 使用,做法是保留 key,赋值给新插入的
阅读全文
摘要:记录一些小技巧 Promise,它的核心奥义是什么?是 resolve 与 reject.例如下面经典的用法.最为核心的就是代码里面的resolve, reject这两个方法。 Promise 就是一个链路,它是有各种 then,then,then 连起来的,规定好了调用顺序,然后呢,链路的触发点就
阅读全文
摘要:记录一些 antd 组件的功能 PortalComponent vs Portal 前者会创建一个 div, 然后 attach 这个 div 到 getContainer 的 DOM 中去,如果没有提供就直接 attach 到 body, 同时它还有第二个功能,就是禁用 attach 的组件的 s
阅读全文
摘要:谈谈 React 里面的一些类型及使用场景 React.Component<P,S,SS>, 这个类型绝对是 react 里面的一哥,P 是 props, S: State, SS: SnapShot. 凡是 class 组件,都得继承这个基类。下面是这个类的 type.d.ts. 生命周期主要参考
阅读全文
摘要:Angular 双向绑定 利用一个例子来看看破坏双向绑定 // parent component html <child [val]='val'/> <button (onClick)="val=1">Reset</button> // child component html <span>{{va
阅读全文
摘要:这篇文章记录一些 css 的基本概念 float 它脱离文档流,相对于它的包含块,放置自己的位置,包含块不是position!=static,这一点跟absolute fix的元素有点区别。包含块指的是它最近的块级祖先。 介绍一下几个属性 offsetTop, offsetLeft, offsetP
阅读全文
摘要:简单介绍一下 AntD Select 的用法 mode: undefined, tag, multiple undefine: 默认值,就是dropdown, tag: 跟multple 唯一的区别就是,输入的值不在list 内,敲回车,自动插入. multiple, 就是多值选择。 一些约定 sh
阅读全文
摘要:谈谈 route in AntD 路由分组与懒加载 路由分组,可以借助于前置匹配exact=,懒加载用于code split webpack 打包时减少初始包的体积,提供性能 路由分组 假设我们有一下路由 /parent/child1 /parent/child2 /parent/child3 那么
阅读全文
摘要:This artical will display the concept of react ReactNode vs ReactElement let's see the code definition. ReactNode is a superset of ReactElement, React
阅读全文
摘要:some little tech note about React and AntD Let's talk a little about ref basic usage example, we refer to the Dom. we prefer the sample1 // in ts cons
阅读全文