I am new to vue.js and I try to close the modal when i update the data. I write this for pencil
<i
class="mdi mdi-pencil"
@click.prevent="$bvModal.show(type.title)"
></i>
This for modal
<b-modal
:id="type.title"
ref="modal"
title="Update holiday type"
centered
hide-footer
>
<FormModal
cardTitle="Update holiday type"
description=""
:value="type.title"
action="update"
@formData="parseFormData"
:holidayTypeID="type.id"
></FormModal>
and this is the function
holidaysTypeUpdate(value, holidayID) {
console.log("Modal title:", value);
console.log("Value id: ", holidayID);
this.$bvModal.hide(value);
session
.put(`api/holidays/holiday-type/${holidayID}/action/`, {
title: value,
})
.then(() => {
this.alertSchema = {
alertVariant: "success",
alertMsg: "Holiday updated",
show: true,
};
this.fetchHolidayTypes();
})
.catch((e) => {
console.log(e.response.data);
});
},
My problem is that when I don’t change anything in data and I press update the modal close, but when I change the data the data changed but modal doesn’t close. How can I solve this?