I'm trying to show a bootstrap modal from a function in VueJS. I'm basically looking for vanilla JS way of doing this: $('#myModal').modal("show"). There are ways to do this with BootstrapVue, but the project I'm currently using does not use bootstrapVue, just standard bootstrap4.
//component.vue
<template>
<div>
<button type="button" class="btn btn-primary">My Modal</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
...
</div>
</div>
</div>
</div>
</template>
<script>
export default {
methods: {
buttonClick() {
// Need to display modal in here
//$('#myModal').modal("show")
}
}
};
</script>