我有一个TypeScript枚举,需要将枚举的值转换为字符串,以便将其传递给API端点。我该如何做?谢谢。
enum RecordStatus {
CancelledClosed = 102830004,
Completed = 102830003,
InProgress = 102830002,
ShoppingCart = 102830005,
Submitted = 102830001,
Unordered = 102830000
}
例子:var submittedStrValue = RecordStatus.Submitted // I want to get "10283001" (note the string value rather than the int value.