aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
author135e2 <[email protected]>2022-08-09 21:46:38 +0800
committer135e2 <[email protected]>2022-08-09 21:46:38 +0800
commitb267795a685881f32488aaed26c72c6dcadb8f44 (patch)
tree3ae54a94622592a0237ec4204325783873238c8a /src/components
parentdcf41098f7ca7e401d307fb5790ab1f989ad4249 (diff)
downloadotonashi-b267795a685881f32488aaed26c72c6dcadb8f44.tar.gz
otonashi-b267795a685881f32488aaed26c72c6dcadb8f44.tar.bz2
otonashi-b267795a685881f32488aaed26c72c6dcadb8f44.zip
feat(EditPage): refine reset() and resetValidation()
Diffstat (limited to 'src/components')
-rw-r--r--src/components/EditPage.vue8
1 files 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();
},