This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2021-10-29 07:48:01 -07:00
|
|
|
<template>
|
|
|
|
<span class="tooltip-wrapper" :title="text" :aria-label="text">
|
|
|
|
<slot></slot>
|
|
|
|
<span class="tooltip-content bg-dark text-white border px-2 py-1 rounded">
|
|
|
|
{{ text }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
text: { required: true },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.tooltip-wrapper {
|
|
|
|
position: relative;
|
|
|
|
.tooltip-content {
|
|
|
|
display: none;
|
|
|
|
position: absolute;
|
|
|
|
top: -2.2rem;
|
|
|
|
left: -50%;
|
|
|
|
font-weight: normal;
|
|
|
|
font-size: .85rem;
|
2021-10-29 08:08:41 -07:00
|
|
|
white-space: nowrap;
|
2021-10-29 07:48:01 -07:00
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.tooltip-content {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|