沒想到連 Dataset 本身也是一個 component,所以要記得匯入並 use 它。
use
// <script setup lang="ts"> import { computed } from 'vue' import { type EChartsOption } from 'echarts' import { use } from 'echarts/core' import { DatasetComponent } from 'echarts/components' import VueECharts from 'vue-echarts' use([ DatasetComponent, ..., ]) const option = computed<EChartsOption>(() => ({ dataset: { ... }, series: { ... }, }))
如果並不在意打包大小,那麼也可以直接一次匯入所有 component,就不需要再呼叫 use() 了。
use()
import "echarts"
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up