【发布时间】:2018-08-02 17:43:35
【问题描述】:
interface Foo {
[foo: "hello" | "world"]: string;
}
我收到类似的错误消息
An index signature parameter type cannot be a union type. Consider using a mapped object type instead.
什么是映射对象类型,如何使用它?
【问题讨论】:
标签: typescript