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.
12 lines
321 B
12 lines
321 B
enum Direction {
|
|
// 枚举中成员的值可以是字符串
|
|
// 字符串枚举没有自增行为,因此,字符串枚举的每个成员必须有初始值
|
|
Up = 'UP',
|
|
Down = 'DOWN',
|
|
Left = 'LEFT',
|
|
Right = 'RIGHT'
|
|
}
|
|
|
|
function changeDirection(direction: Direction) {}
|
|
|
|
changeDirection(Direction.Up)
|