From 275954e6b38c09021c313e1cd00adda940b407ec Mon Sep 17 00:00:00 2001 From: Leo Q Date: Tue, 16 Apr 2024 15:20:07 +0800 Subject: [PATCH] update value normally if value is literally false (#163) --- frontend/components/DynamicForm.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/components/DynamicForm.vue b/frontend/components/DynamicForm.vue index 35c421f3..deb8a8b8 100644 --- a/frontend/components/DynamicForm.vue +++ b/frontend/components/DynamicForm.vue @@ -25,7 +25,11 @@ export default { }, methods: { updateForm (fieldName, v) { - if (!v) { + if (v===false) { + // bool false value, leave it as is + this.$set(this.formData, fieldName, v) + } else if(!v) { + // empty value, remove it this.$delete(this.formData, fieldName) } else { this.$set(this.formData, fieldName, v)