在vue项目中中迁徙图的时候,要引入china.js,但是直接import引入会报错:ECharts is not Loaded

这个报错可以在china.js中找到:

这时我们只需要在echarts不存在的时候重新引入,就可以解决问题。

if (!echarts) {
echarts = require("echarts/lib/echarts");
}
if (!echarts) {
echarts = require("echarts/lib/echarts");
}
本文标题:Vue项目中引入china.js问题
本文链接:https://www.haomeiwen.com/subject/wqozwctx.html
网友评论