
typescript
YoungtoNine
这个作者很懒,什么都没留下…
展开
-
ts中得&和 |
1. 问题type Foo = { name: string age: string}type Bar = { name: string age: string gender: number}type a = keyof Foo | keyof Bartype b = keyof Foo & keyof Bar 今天在做**type-challenges**时,发现个自己之前忽略得东西,那就是**&**和**|**有什么不同2. 类型key中上面**原创 2022-03-30 10:25:46 · 1641 阅读 · 1 评论 -
vue3+vite+element-plus+husky+commitzen搭建项目
1.1 编辑器统一编码规范# http://editorconfig.orgroot = true[*] # 表示所有文件适用charset = utf-8 # 设置文件字符集为 utf-8indent_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 · 938 阅读 · 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 · 264 阅读 · 0 评论