feat(tooltip-icon): make tooltipText slottable

This commit is contained in:
Eric Liu 2021-02-03 06:10:15 -08:00
commit 6b75607dce
6 changed files with 48 additions and 16 deletions

View file

@ -1,5 +1,8 @@
<script>
/** Specify the tooltip text */
/**
* Specify the tooltip text.
* Alternatively, use the "text" slot
*/
export let tooltipText = "";
/**
@ -56,6 +59,8 @@
hidden = false;
}}"
>
<span id="{id}" class:bx--assistive-text="{true}">{tooltipText}</span>
<span id="{id}" class:bx--assistive-text="{true}"
><slot name="text">{tooltipText}</slot></span
>
<slot />
</button>