<template>
  <CollapseItem name="标题设置" :expanded="true">
    <n-tag type="primary">若标题名称的配置无响应，请在预览页面查看效果</n-tag>
    <SettingItemBox :alone="true" name="标题名称">
      <SettingItem :alone="true">
        <n-input v-model:value="optionData.title" type="text" size="small" />
      </SettingItem>
      <SettingItem name="标题横坐标位置">
        <n-input-number
          v-model:value="optionData.titleStyle.x"
          :min="0"
          size="small"
          placeholder="宽度"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="标题纵坐标位置">
        <n-input-number
          v-model:value="optionData.titleStyle.y"
          :min="0"
          size="small"
          placeholder="高度"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
  </CollapseItem>
</template>

<script setup lang="ts">
  import { PropType, watch, ref } from 'vue';
  import { option } from './config';
  import { cloneDeep } from 'lodash-es';
  import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting';

  const props = defineProps({
    optionData: {
      type: Object as PropType<typeof option>,
      required: true,
    },
  });
</script>
