<template>
    <v-chart v-bind="$attrs"></v-chart>
</template>

<script setup lang="ts" name="Charts">
import { getCurrentInstance } from 'vue'
import { use } from 'echarts/core'
import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'
import VChart from 'vue-echarts'
use([CanvasRenderer, SVGRenderer])

const instance = getCurrentInstance()
if (instance) {
    const { proxy } = instance
    console.log('proxy.$attrs', proxy?.$attrs)
} else {
    console.error('无法获取组件实例')
}
// export function useCanvasInitOptions(option: any, themeSetting: any) {
//     const renderer = option.renderer || themeSetting.renderer
//     const initOptions: InitOptions = { renderer }
//     const scaleRef = inject<Ref<{ width: number; height: number }>>(SCALE_KEY) || { value: { width: 1, height: 1 } }

//     if (renderer === 'canvas') {
//         initOptions.devicePixelRatio = Math.ceil(
//             Math.max(window.devicePixelRatio, scaleRef.value.width, scaleRef.value.height)
//         )
//     }
//     return initOptions
// }
</script>

<style lang="scss"></style>
