From b267795a685881f32488aaed26c72c6dcadb8f44 Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Tue, 9 Aug 2022 21:46:38 +0800 Subject: feat(EditPage): refine reset() and resetValidation() --- src/components/EditPage.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/EditPage.vue b/src/components/EditPage.vue index 21d9ea9..84548cd 100644 --- a/src/components/EditPage.vue +++ b/src/components/EditPage.vue @@ -130,6 +130,10 @@ export default { // Resets errors bag when using the lazy-validation prop. form.reset(); }, + resetValidation(form) { + // Resets validation of all registered inputs without modifying their state + form.resetValidation(); + }, write(form) { if (form == this.$refs.form1 && this.title in this.LSData) { this.$emit("snackbarNotification", "Title already exists"); @@ -142,8 +146,8 @@ export default { this.LSData[this.title] = this.content; this.writeToLS(); this.$emit("snackbarNotification", "Done!"); - // Let's do a reset. - this.reset(form); + // Let's do a validation reset. + this.resetValidation(form); // Re-read all items. this.readAllItems(); }, -- cgit v1.2.3