I am incorporating Tooltips
into my project, utilizing Vue 3
and Bootstrap 5
.
In the script section, I have included the following:
<script>
import { Tooltip } from "bootstrap/dist/js/bootstrap.esm.min.js";
export default {
mounted() {
Array.from(document.querySelectorAll('button[data-bs-toggle="tooltip"]'))
.forEach((tooltipNode) => new Tooltip(tooltipNode));
}
}
</script>
Although it works fine on buttons in my template, it does not seem to work on input fields. Here is an example of how I tried to implement it:
<template>
<button type="button" class="btn btn-secondary me-2" data-bs-toggle="tooltip" data-bs-placement="top" title="Tooltip on top">
Tooltip on top
</button>
<input
type="text"
class="form-control"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
:title="txt_input"
:value="txt_input"
readonly
/>
</template>
I am unable to identify why it is not functioning as expected. Any assistance would be greatly appreciated! Thank you.