<template>
  <div class="GeneralHead">
    <Title :title="option.title" :w="w" :h="h" :titleStyle="option.titleStyle" />
  </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({
    title: props.chartConfig.option.title,
    titleStyle: props.chartConfig.option.titleStyle,
  });
</script>

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