1. import js
import { Modal } from 'bootstrap/dist/js/bootstrap'
2.调用API (模态框ID)
// 创建一个模态框实例
const myModal = new Modal(document.getElementById('myModal'));
// 显示模态框
myModal.show();
// 隐藏模态框
myModal.hide();
//设置定时关闭
setTimeout(function () {
myModal.hide();
}, 1000)