{{ n }}
import {
ref,
onMounted,
nextTick }
from 'vue'
const
chartRef =
ref(null)
const data =
ref([])
const
initChart =
async () => {
// 等待数据加载完成
await
fetchData()
// 👈 等待 DOM 更新后再渲染图表
await
nextTick()
const
chart =
echarts.init(chartRef.value)
chart.setOption({ ... })
}