type Props = { a: number; b: string; c: boolean } // 查看 Props 中 a 的类型 type TypeA = Props['a'] // 模拟 Partial 类型: type MyPartial = { [P in keyof T]?: T[P] // p 相当于 key } type PartialProps = MyPartial // 索引其它查询方式:同时查询多个索引的类型 type TypeB = Props['a' | 'b'] type Props2 = { a: number; b: number; c: boolean } type TypeC = Props2['a' | 'b'] // a 和 b 类型都是 number,TypeD 只显示一个 number,实现去重功能 type TypeD = Props2[keyof Props]