如何在Typescript中使用Array.find()传递给ES5

时间:2017-12-14 01:13:02

标签: javascript typescript vue.js gulp

我试图在打字稿中这样做:

var component = components.find(c => c.Id == 5);

错误属性'找到'类型为[]

时不存在

我不想转发到ES6。

我的环境:

  • Windows 7
  • vs2015
  • Vue 2.4.2
  • 在tsconfig.json

    compiler options:
    ...
    "lib": ["es6"], (this does not work)
    "target": "es5"
    ...
    
  • 使用gulp进行使用ts-loader 2.3.2
  • 的构建
  • 发现了这个Find Object in Array using TypeScript,但不知道如何实施pollyfill。

0 个答案:

没有答案