首页 > 解决方案 > D3.js 版本 3 是否支持 es6/es2015

问题描述

在此处输入图像描述D3 版本 3 是否支持 es2015/es6?d3 使用 es2015 和 angular 可以正常工作,但是当升级到 angular 8 时,d3 开始给我一个运行时错误。“文档未定义”

        "d3": "3.5.17",
        "@angular/animations": "^8.0.2",
        "@angular/cdk": "^8.0.1",

{//tsconfig.json
  "compilerOptions": {
    "allowJs": true,
    "downlevelIteration": true,
    "target": "es5",
    "module": "esnext",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "es2015",
      "es2017",
      "dom",
      "esnext.asynciterable" // Enable async generators. See https://stackoverflow.com/a/43694282/62694.
    ],

标签: d3.jsecmascript-6

解决方案


推荐阅读