Highchart 3D模块在Angular 9.1.4中无法使用。

问题描述 投票:0回答:1

我在我的Angular项目中使用Highchart,一切都很好,但是当我更新我的Angular cli到9.1.4时,声明开始抛出以下错误( 错误截图) https:/prnt.cscl6g8)

Argument of type 'typeof import("/project/node_modules/highcharts/highcharts")' is not
assignable to parameter of type 'typeof import("/project/node_modules/highcharts/highcharts.src")'.
Property 'ZAxis' is missing in type 'typeof import("/project/node_modules/highcharts/highcharts")' 
but required in type 'typeof import("/project/node_modules/highcharts/highcharts.src")'.ts(2345)
highcharts-3d.src.d.ts(19, 9): 'ZAxis' is declared here.

以下是导入语句

import { Component, OnInit, Input } from '@angular/core';
import * as Highcharts from 'highcharts';
import highcharts3D from 'highcharts/highcharts-3d.src';
highcharts3D(Highcharts); // the above error is thrown on this line
angular typescript highcharts
1个回答
1
投票

try : import * as Highcharts from 'highchartshighcharts.src';

instead : import * as Highcharts from 'highcharts';

© www.soinside.com 2019 - 2024. All rights reserved.