37 lines
717 B
Vue
Raw Normal View History

2022-01-14 22:07:02 +08:00
<template>
2022-02-02 18:17:45 +08:00
<VChart theme="dark" :option="option" autoresize />
2022-01-14 22:07:02 +08:00
</template>
<script setup lang="ts">
2022-02-02 18:17:45 +08:00
import { computed, PropType } from 'vue'
import VChart from 'vue-echarts'
import { use, graphic } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { PieChart } from 'echarts/charts'
import {
GridComponent,
TooltipComponent,
LegendComponent
} from 'echarts/components'
import config from './config'
2022-01-14 22:07:02 +08:00
2022-02-02 18:17:45 +08:00
const props = defineProps({
chartData: {
type: Object as PropType<config>,
required: true
}
})
2022-01-14 22:07:02 +08:00
2022-02-02 18:17:45 +08:00
use([
CanvasRenderer,
PieChart,
GridComponent,
TooltipComponent,
LegendComponent
])
2022-01-14 22:07:02 +08:00
2022-02-02 18:17:45 +08:00
const option = computed(() => {
return props.chartData.option
})
</script>