Typescript进阶
从类型中选取某一个
ts对象的类型为枚举中的类型
enmu EnhanceKeyValue = { key1 = 'key'}
type EnhanceKeyValue = { [key in keyof typeof EnhanceKey]?: string;}
const test: EnhanceKeyValue {} //属性为EnhanceKeyValue的值从类型中选取某一个
ts对象的类型为枚举中的类型
enmu EnhanceKeyValue = { key1 = 'key'}
type EnhanceKeyValue = { [key in keyof typeof EnhanceKey]?: string;}
const test: EnhanceKeyValue {} //属性为EnhanceKeyValue的值同一 IP 全站 12 小时内只计一次