Typescript体操求助,怎样得到对象的 value类型?-灵析社区

春暖花又开

ts怎样得到value的类型 `['单选题','多选题','判断题',]` const enum_option_type = { 0: '单选题', 1: '多选题', 2: '判断题', }

阅读量:137

点赞量:0

问AI
type Keys = keyof typeof enum_option_type; type Values = typeof enum_option_type[Keys];