构建d3-tip时的Webpack警告

时间:2017-11-10 10:50:20

标签: javascript d3.js

我已使用以下代码在d3-tip实施中包含d3

import * as d3 from "d3";
import * as d3Tip from "d3-tip";
d3.tip = d3Tip;

但是,我收到以下警告:

WARNING in ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/opsboard/opsboard.vue
75:16-22 "export 'tip' (imported as 'd3') was not found in 'd3'

任何人都有任何想法出了什么问题?提示工作正常。因为我将d3.tip指定为d3Tip我不明白为什么要将其导出...

1 个答案:

答案 0 :(得分:0)

此代码不应引起警告:

import * as d3 from "d3";
import d3Tip from "d3-tip";
...
const tip = d3Tip();
svg.call(tip);

希望有帮助