修复地图初始化时 echarts 模块导入问题
This commit is contained in:
@@ -238,11 +238,13 @@ async function initMapChart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [echarts, worldResponse] = await Promise.all([
|
const [echartsModule, worldResponse] = await Promise.all([
|
||||||
import('echarts'),
|
import('echarts'),
|
||||||
fetch('/world.json'),
|
fetch('/world.json'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const echarts = echartsModule.default || echartsModule
|
||||||
|
|
||||||
if (!mapChart.value) {
|
if (!mapChart.value) {
|
||||||
console.warn('Map chart container was unmounted during initialization')
|
console.warn('Map chart container was unmounted during initialization')
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user