在封装axios请求根据error.response.status取自己定义的索引值时,提示警告:

TS:元素隐式具有 “any“ 类型,因为类型为 “any“ 的表达式不能用于索引类型

 

 

还或者遇到这种情况

TS:元素隐式具有 “any“ 类型,因为类型为 “any“ 的表达式不能用于索引类型

 

 

 

可以在我们的tsconfig.json中设置"suppressImplicitAnyIndexErrors": true就可以了

TS:元素隐式具有 “any“ 类型,因为类型为 “any“ 的表达式不能用于索引类型

 

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-07-22
  • 2022-12-23
  • 2022-02-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-04-07
  • 2022-12-23
  • 2022-01-30
相关资源
相似解决方案