Angular支持IE11的方法

时间:2025-04-02 08:50:27

只需要简单更改Type Script的配置:

=es5

// 
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es5",
...
}

使用cli生成出来的值默认是es2015,所以IE11无法识别运行。