前端前端
fabric
算法
jsBlock
styleBlock
svgBlock
工具其他
Vue、React相关
webgl
GitHub
fabric
算法
jsBlock
styleBlock
svgBlock
工具其他
Vue、React相关
webgl
GitHub
  • eslint
  • git
  • github访问
  • jenkins
  • linux
  • make
  • Markdown基本写法
  • mysql安装
  • nginx
  • node安装
  • php安装
  • rabbitMQ
  • typescript
  • vuepress搭建

typescript

  1. Exclude<T, U>,T有,U没有
type ResT = Exclude<"a"|"b"|"c", "c"|"d">
// ResT = "a"|"b"
  1. Extract<T, U>,T、U交集
type ResT = Extract<"a"|"b"|"c", "c"|"d">
// ResT = "c"
  1. Pick<T, K>,从T中取出K
ExampleTyle = {
  lable: string
  id: string
}
const ResT = Pick<ExampleTyle, 'lable'>
// ResT = {label: string}
  1. Omit<T, K>,从T中去除K
ExampleTyle = {
  id: string
  lable: string
  name: string
}
const ResT = Omit<ExampleTyle, 'lable'>
// ResT = {
//   id: string
//   name: string
// }
Edit this page
最近更新:: 2021/8/12 16:22
Contributors: wuhui
Prev
rabbitMQ
Next
vuepress搭建