Skip to content

Commit

Permalink
When updating form, if field value is empty, delete the field.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoQuote committed Mar 28, 2024
1 parent 9b06591 commit dd08609
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/components/DynamicForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export default {
},
methods: {
updateForm (fieldName, v) {
this.$set(this.formData, fieldName, v)
if (!v) {
this.$delete(this.formData, fieldName)
} else {
this.$set(this.formData, fieldName, v)
}
this.$emit('input', this.formData)
},
getComponent(field) {
Expand Down

0 comments on commit dd08609

Please sign in to comment.