You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
321 B

2 years ago
  1. enum Direction {
  2. // 枚举中成员的值可以是字符串
  3. // 字符串枚举没有自增行为,因此,字符串枚举的每个成员必须有初始值
  4. Up = 'UP',
  5. Down = 'DOWN',
  6. Left = 'LEFT',
  7. Right = 'RIGHT'
  8. }
  9. function changeDirection(direction: Direction) {}
  10. changeDirection(Direction.Up)