* 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
57 lines
826 B
Vue
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>
|