I want to use Tooltips inside of my project where I'm using Vue 3 and Bootstrap 5.
I have done following in my script:
<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>
now I want to use it inside of my template. On the following button it works out well, but I could not use it on my input.
<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 could not figure out why it is not working. Thanks for your help!