Hello ,
Metronic Vue demo 8
when I want add customer the popup opening and data in some fields are existing , when I click discard the data clear from fields , the issue here when I click The sign of the exit popup and click add customer again , The data that appeared in the popup when adding a customer does not appear again .
this is the link :
https://preview.keenthemes.com/metronic8/vue/demo8/?_ga=2.71315155.1104186020.1694596631-1780376720.1674214128#/apps/customers/getting-started
Metronic
Vue demo 8 version 8.1.6
node v18.14.1
npm 9.6.0
Hi,
If you don't refresh the page, the data you've filled will remain in your input fields. To ensure the form always starts with the same values when a user opens the modal, you can reset the form data within the Bootstrap show.bs.modal
event.
Here is an example:
const initData = {
name: "Sean Bean",
email: "sean@dellito.com",
description: "",
addressLine: "101, Collins Street",
addressLine2: "",
town: "Melbourne",
state: "Victoria",
postCode: "3000",
country: "US",
};
const formData = ref(initData);
onMounted(() => {
addCustomerModalRef.value?.addEventListener("show.bs.modal", function () {
formData.value = { ...initData };
});
});