我已使用以下代码在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
我不明白为什么要将其导出...
答案 0 :(得分:0)
此代码不应引起警告:
import * as d3 from "d3";
import d3Tip from "d3-tip";
...
const tip = d3Tip();
svg.call(tip);
希望有帮助