因为 TS 推断出来的 `this.obj` 只有一个确切的键 `'text'`,而 `for...in` 遍历出来的键 `key`,类型被推断为 `string`,所以 TS 认为 `key` 不是 `this.obj` 的键。 虽然不知道 TS 为啥会这样“睁着眼睛说瞎话”,但事情就是这么个事情。 可以对`key`作类型断言: for(const key in this.obj){ console.log(this.obj[key as keyof typeof this.obj]); } 但是这样的方法显然不甚讨喜,如果仅仅是把 `this.obj` 作为键值对容器使用的话,可以将其类型定义为`Record`: { obj:Record = { text: null } }