【发布时间】:2019-12-07 09:33:36
【问题描述】:
我有一个数组
const relations = ['profiles', 'locations', 'change_history']
如果我想创建一个类似的界面
interface IParams {
id: number;
relations: []string; // how to make this an array of those relations above?
}
我该怎么做?
【问题讨论】:
-
string[]怎么样?还是您在寻找更具体的东西?比如['profiles', 'locations', 'change_history']本身 -
寻找特定的东西。谢谢
标签: typescript