【发布时间】:2020-05-03 06:36:58
【问题描述】:
我有一门课如下。
export class Cars implements Vehicales {
color?: string;
type?: string[];
}
由于某种原因,我无法修改上述导出对象。 模板对象被传递给 kendoReactGrid ,其中包含列的所有字符串,我只需要在我的界面中添加它,而不是导出对象。
我有一个界面如下
interface CarpProps {
templates: Cars[]
}
现在我想向我的模板对象添加一个附加属性tyreCount: string[]。
我怎样才能在打字稿界面中做到这一点?
我在 extends 关键字期间尝试过,但没有成功。
我是打字稿的新手,任何帮助将不胜感激。
【问题讨论】:
标签: reactjs typescript react-hooks