【发布时间】:2021-06-13 22:50:04
【问题描述】:
我有两种类型,一种继承了其他的所有属性,所以我将它们全部重写在孩子身上。有写这个的捷径吗?
type Parent = {
a: string,
b: string
}
type Child = {
a: string,
b: string,
c: number
}
【问题讨论】:
-
type Child = Parent & { ... }? -
这能回答你的问题吗? Possible to extend types in Typescript?
标签: typescript