My code contains multiple buttons that trigger the function showModal(title)
.
showModal(title) {
this.modalTitle = title
this.$bvModal.show("add-modal")
}
Below is the specific modal being targeted.
<b-modal
id="add-modal"
ref="modal"
v-bind:title="'Add Item to ' + modalTitle + ' list'"
...
I would like to have only one <b-modal>
tag within the Vue component, but be able to open it with multiple buttons. Initially, each modal (with different titles) opens correctly on page load. However, after making changes to the code and reloading the browser, opening a new modal results in old modals appearing on top of the current one.
Is there a way to prevent multiple modals from overlapping and ensure that only one modal is opened after refreshing the browser?
Thank you