我把highcharts和highcharts-vue一起用。
我有几个插件加载和工作的预期:
import Vue from 'vue';
import Highcharts from 'highcharts';
import HighchartsVue from 'highcharts-vue';
import stockInit from 'highcharts/modules/stock';
import noDataToDisplay from 'highcharts/modules/no-data-to-display';
import solidGauge from 'highcharts/modules/solid-gauge';
if (typeof Highcharts === 'object' && typeof window !== 'undefined') {
stockInit(Highcharts);
solidGauge(Highcharts);
noDataToDisplay(Highcharts);
}
Vue.use(HighchartsVue, {tagName: 'charts'});
但是我刚刚添加的实体计量器模块产生了一个错误:
Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at a (solid-gauge.js:15:327)
at eval (solid-gauge.js:15:388)
at eval (solid-gauge.js:16:308)
at eval (solid-gauge.js:19:291)
at f (solid-gauge.js:11:175)
at eval (solid-gauge.js:14:442)
at eval (highcharts.js:34:72)
at Module../plugins/highcharts.js (app.js:5244:1)
at __webpack_require__ (runtime.js:854:30)
我几乎看不出我如何能从这一步进一步调查。
我确实更新了我的highcharts npm依赖关系到10.0.1
,但错误仍然发生。
我们将非常感谢您的帮助!
干杯
1条答案
按热度按时间u2nhd7ah1#
您需要在导入和初始化
solid-gauge
之前导入和初始化highcharts-more
模块。现场演示:https://jsfiddle.net/BlackLabel/2dqL70hy/