在vue項(xiàng)目中中遷徙圖的時(shí)候,要引入china.js,但是直接import引入會報(bào)錯(cuò):ECharts is not Loaded

image.png
這個(gè)報(bào)錯(cuò)可以在china.js中找到:

image.png
這時(shí)我們只需要在echarts不存在的時(shí)候重新引入,就可以解決問題。

image.png
if (!echarts) {
echarts = require("echarts/lib/echarts");
}