在编译时候报‘Property 'filter' does not exist on type 'Element'.’的错,但是在浏览器中运行正常。如下图:

 TS问题:属性'filter'在类型'Vue'上不存在

 

 经过不懈的努力,终于找到了原因。是因为tslint检查时不知道this.$refs.tree的类型,因此才报这个错。只要用ts的类型断言给他指定类型就不会报错了。

TS问题:属性'filter'在类型'Vue'上不存在

 

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-05-27
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案