[英]how to define interface for the following date type
我正在尝试为 this.usedPercentageFilterOptions 定义接口类型。 你知道下面的接口声明是否正确吗?
`
interface Item {
filterPillValue: string,
id: string,
label: string
}
interface Items {
radio: Item,
checkbox: Item
}
public usedPercentageFilterOptions: Items[]
this.usedPercentageFilterOptions = [
{
radio: { filterPillValue: 'used%', id:'filter-used-%', label: 'Used %' },
checkbox: [
{ filterPillValue: 'Full', id:'filter-full', label: 'Full' },
{ filterPillValue: 'Reached Critical threshold', id:'filter-critical-threshold', label: 'Reached Critical threshold' },
{ filterPillValue: 'Reached Warning threshold', id:'filter-warning-threshold', label: 'Reached Warning threshold' },
{ filterPillValue: 'Not reached threshold', id:'filter-not-reached-threshold', label: 'Not reached threshold' }
]
}
];`
尝试这个
export interface Cb {
filterPillValue?: string;
id?: string;
label?: string
}
和
export interface UsedPer {
radio?: Cb;
checkbox?: Cb[]
}
希望有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.