我使用 dayJS 作为我的日期时间库,并希望呈现所有时区的列表。
我尝试使用 Intl 对象:
Intl.supportedValuesOf("timeZone")
但出现打字稿错误:
TS2339: Property 'supportedValuesOf' does not exist on type 'typeof Intl'.
我可以获取值,但我想避免使用 @ts-ignore 表示法
如何为 Intl 对象添加更新的类型?
小智 5
请参阅https://github.com/microsoft/TypeScript/issues/49231
“更改直到 Typescript 5.1 才会发布”
| 归档时间: |
|
| 查看次数: |
2006 次 |
| 最近记录: |