Open nongtan7898 opened 1 day ago
Hello @nongtan7898. Bug reports must include a live demo of the issue. Per our contributing guidelines, please create a reduced test case on CodePen or StackBlitz and report back with your link, Bootstrap version, and specific browser and Operating System details.
this Reduced test cases https://stackblitz.com/edit/vitejs-vite-lp48zk?file=src%2Fmain.js
I'd say that you need to get access to the instance of the modal. I'm not that familiar with Vue.js, but you could try to add this to the main.js
:
import * as bootstrap from 'bootstrap';
window.bootstrap = bootstrap;
And then, in App.vue
, something like:
const close = () => {
const modalInstance = bootstrap.Modal.getOrCreateInstance('#exampleModal');
modalInstance.hide();
};
Prerequisites
Describe the issue
I am having trouble closing the modal using jquery.
vite vue jquery bootstrap 5.3
Reduced test cases
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.3.3