const someObj:ObjectType = data;
const field = 'username';
// This gives an error
const temp = someObj[field];
报错:
Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘Object’.
No index signature with a parameter of type ‘string’ was found on type ‘Object’.