变量中对象的属性名称
问题描述:
打字稿中是否可以通过变量设置属性名称?
Is there a way in typescript to set a property name from a variable?
类似这样的东西
export function objectFactory(prop: string) {
return {
prop: {
valid: false
}
};
}