我有一个Typescript界面
export interface MyInterface {
valid: boolean;
resourceType: MyEnum;
message: string;
}
和一个枚举
enum MyEnum {
'a',
'b',
'c'
}
是否可以将MyInterface.resourceType的值设为MyEnum中的任何值?
当前我的IDE抛出错误
property 'resourceType' of exported interface has or is using private
name 'MyEnum'
答案 0 :(得分:2)
尝试导出枚举
export enum MyEnum {
a = 'a',
b = 'b',
c = 'c'
}