我有以下两个文件:bag.js
import {BagType} from "./bagType" //this line of code gives an error message: bagtype.ts is not a modul
import {Present} from "./present";
export class Bag {
private maxWeight: number;
private bagType: BagType;
private presents: Array<Present> = new Array<Present>();
constructor(maxWeight: number, bagType: BagType) {
this.maxWeight = maxWeight;
this.bagType = bagType;
}
public addPresent(present: Present){
this.presents.push(present);
}
}
和bagType.js
enum BagType {
Canvas,
Paper
}
我的问题是下一个:如何将枚举BagType导入Bag类?
答案 0 :(得分:3)
我尝试了它并且它适用于:
import {BagType} from "./bagType";
和
if CheckBoxesB.IsSelected('All') == True:
CheckBoxesA.Reset()