elk/components/common/CommonTooltip.vue

27 lines
463 B
Vue
Raw Normal View History

2022-11-24 06:04:20 +01:00
<script setup lang="ts">
import type { Popper as VTooltipType } from 'floating-vue'
2023-02-08 10:20:58 +01:00
export interface Props extends Partial<typeof VTooltipType> {
2022-11-24 09:34:05 +01:00
content?: string
2023-02-08 10:20:58 +01:00
}
defineProps<Props>()
2022-11-24 06:04:20 +01:00
</script>
<template>
<VTooltip
v-if="isHydrated"
2022-11-24 06:04:20 +01:00
v-bind="$attrs"
auto-hide
2022-11-24 06:04:20 +01:00
>
<slot />
<template #popper>
<div text-3>
2022-11-24 09:34:05 +01:00
<slot name="popper">
{{ content }}
</slot>
2022-11-24 06:04:20 +01:00
</div>
</template>
</VTooltip>
</template>