![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
typescript
YoungtoNine
这个作者很懒,什么都没留下…
展开
-
ts中得&和 |
1. 问题 type Foo = { name: string age: string } type Bar = { name: string age: string gender: number } type a = keyof Foo | keyof Bar type b = keyof Foo & keyof Bar 今天在做**type-challenges**时,发现个自己之前忽略得东西,那就是**&**和**|**有什么不同 2. 类型key中 上面**原创 2022-03-30 10:25:46 · 1585 阅读 · 1 评论 -
vue3+vite+element-plus+husky+commitzen搭建项目
1.1 编辑器统一编码规范 # http://editorconfig.org root = true [*] # 表示所有文件适用 charset = utf-8 # 设置文件字符集为 utf-8 indent_style = space # 缩进风格(tab | space) indent_size = 2 # 缩进大小 end_of_line = lf # 控制换行类型(lf | cr | crlf) trim_trailing_whitespace = true # 去除行首的任意空白字符 in原创 2022-02-21 20:57:58 · 854 阅读 · 0 评论 -
typescript中的高级类型
typescript中的高级类型 Partial 将一个类型所有参数转换为可选 type Partial <T> { [P in keyof T]?:T[P] } type Man { sex:string, age:number } type ManPartial = Partial<Man> // 这样我们就可以在后续中使用空对象定义一个带有类型的值 let obj:ManPartial | any = {} Exclude 取出T中除了U以外的,即取出T有U没有的原创 2021-06-04 14:56:07 · 211 阅读 · 0 评论