Answer the question
In order to leave comments, you need to log in
How to make modal window on nuxt.js via bootstrap api?
Hello, I’m making a site on nuxt.js , the
task was to make modal windows
layout using bootstrap5 (import scss)
to connect js from bootstrap5
googled that you need to create a bootstrap.js file in the plugins folder
and place import * as bootstrap from 'bootstrap/dist/js/ bootstrap.esm.min'
if you make a modal or a drop-down list through data-attributes bs-....
everything works as it should,
but I write my own modal window component
there I will have a button in a verst
and the modal itself - everything is like in the bootstrap dock
with click on the "open window" button, I want to programmatically call a modal
and also hang all the callbacks and a bunch of requests should happen, etc. - not the point
I can't use Modal api from bootstrap
I have this code
<script>
import {Modal} from 'bootstrap/dist/js/bootstrap.esm.min';
export default {
name: "OrderStatus",
data() {
return {}
},
methods: {
click() {
let myModal = new Modal(document.getElementById('exampleModal'))
console.log(myModal)
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question