【发布时间】:2020-10-25 02:11:36
【问题描述】:
我有这样的类型:
export type Model = {
Id: number,
Name: string
}
以及这样的 JSON 响应:{"id": 0, "name": "User"}。
在 Axios 解析该响应 (const response = await Axios.get<Model>(source)) 后,我得到下一个对象:
Id: undefined Name: undefined id: 0 name: "User"
如何正确解析对 PascalCase 模型类型的响应?
`
【问题讨论】:
-
看看this。你在找什么?
标签: json typescript axios