How to reset/destroy modal after form is submitted
Hi,
Currently using the following demo:
https://preview.keenthemes.com/metronic8/vue/demo1/#/apps/customers/customers-listing
- Click `Add Customer`
- Change the name to `test 1` or anything else
- Click `Submit`
- Click `Add Customer`
- Notice that the name is still what you set earlier
Is there a way to reset the modal to its initial state?
Thanks
Replies (1)
Hi Diego,
Yes, you can easily reset form using resetFields() function.
Just call this function whenever you want to reset the form to the initial state.
formRef.value!.resetFields();
For more usage examples you can check Element Plus official doc.
Regards,
Lauris Stepanovs,
Keenthemes Support Team