📜  来自变量的 ts 对象字段 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:15.997000             🧑  作者: Mango

代码示例1
// use braces to access an object field from a variable
// use keyof to remove the 'any' type error

activeVideo = videos[target.value as keyof IVideoData];