Skip to content

Commit ce54a33

Browse files
committed
refactor: rename cleanFormData to setDefaultFormData and call before FormRoot mount
1 parent 11e53a7 commit ce54a33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vue-json-form/src/components/FormRoot.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,15 @@ function initDefaultFormData() {
227227
};
228228
}
229229
230-
function cleanFormData() {
230+
function setDefaultFormData() {
231231
formData.value = {
232232
...defaultFormData.value,
233233
};
234234
}
235235
236236
function resetForm(evt: Event) {
237237
evt.preventDefault();
238-
cleanFormData();
238+
setDefaultFormData();
239239
formStateWasValidated.value = false;
240240
}
241241
@@ -312,6 +312,7 @@ onBeforeMount(async () => {
312312
renderInterface: props.renderInterface,
313313
});
314314
initDefaultFormData();
315+
setDefaultFormData();
315316
});
316317
317318
watch(props, (newVal) => {

0 commit comments

Comments
 (0)