Hi FE !
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub

eg1

type 别名 = 类型

type Str = string // 定义

const str1:Str = 'abc'
const str2:string = 'abc'

eg2

 type NewType = string | number

 let a: NewType = 1
 let b: NewType = '1'

别名可以是任意的合法字符串,一般首字母大写

Edit this page
最近更新: 2025/12/2 01:46
Contributors: qdleader
qdleader
本站总访问量 129823次 | 本站访客数 12人