I am using bootstrap-vue
as for the modal. When I click on button OPEN MODAL
it opens the modal which contains footer button as OK
and CANCEL
. These buttons closes the modal, as its pre defined code from bootstrap-vue.
I tried to add button inside the modal called CLOSE MODAL USING THIS BUTTON
, which is suppose to close the modal but it does not. Is there a way to make CLOSE MODAL USING THIS BUTTON
to close out from modal?
View
<div id="app">
<b-button v-b-modal.modal-scrollable variant="info" v-on:click="opensModal">Open Modal</b-button>
<b-modal id="modal-scrollable" scrollable title="Waiver Legal" v-show="!displayModal">
<p class="my-4">
"Contains modal detail"
</p>
<b-button variant="info" data-dismiss="modal-scrollable" v-on:click="closeModal">CLOSE USING THIS BUTTON</b-button>
<br>
</b-modal>
</div>
Script
new Vue({
el: "#app",
data: {
clickOnButton: true,
displayModal: true
},
methods: {
opensModal(){
this.clickOnButton = false; <!-- it opens the modal -->
},
closeModal(){
this.displayModal = false; <!-- it does not close -->
}
}
})
Below is the link above code on JSFIDDLE