我正在使用 ionic 4 来构建一个应用程序。而我的应用程序在浏览器上运行良好,但是当我构建 android 平台时,它给了我这一行的错误
for (let [index, p] of this.cart.entries())
我的 typescript 版本是 3.7.2
错误是
Type 'IterableIterator<[number, any]>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
最佳答案
我通过在 tsconfig.json 文件的 compilerOptions 中添加 "downlevelIteration": true 来解决它。注意我的目标是 es2015
关于typescript - 类型 'IterableIterator<[number, any]>' 不是数组类型或字符串类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59105513/