typescript基础 类型声明,限定和断言 类型推断 下面这种示例是ts自动推断 let str = '123' str = 123 // 类型错误:不能将类型"number"分配给类型"string" 游鹄君2026/5/13大约 1 分钟typescripttypescript前端