fix(Tooltip): missing conditions on slots

This commit is contained in:
Benjamin Canac
2024-03-27 16:45:03 +01:00
parent c060b461e9
commit d00084c54c

View File

@@ -57,11 +57,11 @@ const ui = computed(() => tv({ extend: tooltip, slots: props.ui })())
<TooltipPortal :disabled="!portal">
<TooltipContent v-bind="contentProps" :class="ui.content({ class: props.class })">
<slot name="content">
<span v-if="text" :class="ui.text()">
<span v-if="text || $slots.text" :class="ui.text()">
<slot name="text">{{ text }}</slot>
</span>
<span v-if="shortcuts?.length" :class="ui.shortcuts()">
<span v-if="shortcuts?.length || $slots.shortcuts" :class="ui.shortcuts()">
<slot name="shortcuts">
<UKbd v-for="(shortcut, index) in shortcuts" :key="index" size="xs" v-bind="typeof shortcut === 'string' ? { value: shortcut } : shortcut" />
</slot>