nidus-sync/ts/components/Tooltip.vue
Eli Ribble 9dccd21cee
RMO frontend checkpoint
* Create a nwe AddressAndMapLocator which abstracts out the behavior of
   selecting a location
 * Fix the overlay causing render errors on the MapLocator by getting
   rid of the overlay and just using a lock indicator
 * Fix MapLocator zooming in to the wrong place by not framing the
   markers
 * Remove Latlng from platform and just use Location with optional
   accuracy
 * Use nested types with form-encoded POST
 * Fix styles on water report page
2026-04-09 17:21:35 +00:00

57 lines
826 B
Vue

<template>
<span
ref="tooltipElement"
data-bs-toggle="tooltip"
:data-bs-placement="placement"
:title="title"
>
<slot></slot>
</span>
</template>
<script>
import { Tooltip } from "bootstrap";
export default {
name: "BsTooltip",
props: {
title: {
type: String,
required: true,
},
placement: {
type: String,
default: "top",
validator(value) {
return ["top", "bottom", "left", "right"].includes(value);
},
},
},
data() {
return {
tooltip: null,
};
},
mounted() {
this.tooltip = new Tooltip(this.$refs.tooltipElement);
},
beforeUnmount() {
if (this.tooltip) {
this.tooltip.dispose();
}
},
watch: {
title(newTitle) {
if (this.tooltip) {
this.tooltip.dispose();
this.tooltip = new Tooltip(this.$refs.tooltipElement);
}
},
},
};
</script>