echart的使用
npm install echarts
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as echarts from 'echarts'
import 'echarts-liquidfill'
const people = ref('21211人')
const echartLiquid = ref()
onMounted(()=>{
const myCharts = echarts.init(echartLiquid.value) // 获取echart的实例
myCharts.setOption({
title: { text: '水球图' },
xAxis: {},
yAxis: {},
series: {
type: 'bar',
data: [10, 20, 30, 40]
}
})
})
</script>