<template>
  <div class="title">
    <Title :data="option.data" :w="w" :h="h" :dataStyle="option.dataStyle" />
  </div>
</template>

<script setup lang="ts">
  import { computed, PropType, toRefs, watch, reactive, ref } from 'vue';
  import { CreateComponentType } from '@/packages/index.d';
  import { icon } from '@/plugins';
  import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
  import { useChartDataFetch } from '@/hooks';
  import Title from './svg/title.vue';

  const props = defineProps({
    chartConfig: {
      type: Object as PropType<CreateComponentType>,
      required: true,
    },
  });

  const { w, h } = toRefs(props.chartConfig.attr);

  const option = reactive({
    data: props.chartConfig.option.data,
    dataStyle: props.chartConfig.option.dataStyle,
  });
</script>

<style lang="scss" scoped>
  .title {
    width: v-bind('`${w}px`');
    height: v-bind('`${h}px`');
  }
</style>
