<template>
  <div class="tooltip-wrapper">
    <a-tooltip :placement="placement" v-if="props.tooltipConfig.visible" :trigger="trigger">
      <template #title>{{ props.tooltipConfig.title }}</template>
      <span></span>
      <slot></slot>
    </a-tooltip>
    <slot v-else></slot>
  </div>
</template>
<script lang="ts" setup>
  const placement = 'bottomLeft'; //气泡框位置，可选 top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom
  const trigger = 'hover'; //	触发行为，可选 hover/focus/click/contextmenu
  const props = defineProps({
    tooltipConfig: {
      type: Object,
      default: () => {
        return {
          visible: false, //是否需要文字提示tooltip
          title: '气泡框文本内容', //气泡框内容
        };
      },
    },
  });
</script>
