HarmonyOS ArkTS 中enum枚举类型

HarmonyOS ArkTS 中enum枚举类型可以为一组数值赋予友好的名字。

关于HarmonyOSenum枚举类型 您也可以学习HarmonyOS Next视频教程https://www.itying.com/category-93-b0.html

enum Color {Red, Green, Blue};
let c: Color = Color.Green;
enum PageState {
  Loading = 0,
  Success = 1,
  Fail = 2
}

let p: PageState = PageState.Success

更多关于HarmonyOS ArkTS 中enum枚举类型的实战教程也可以访问 https://www.itying.com/category-93-b0.html

回到顶部