Vue-Formulate 重置不会重新触发验证消息

Vue-Formulate reset does not re-trigger validation message

这个例子展示了一个用 vue-formulate 制作的非常小的表单:

https://codesandbox.io/s/vue-formulate-reseting-form-does-not-initiate-validation-message-again-yxruq

输入字段需要至少 4 个字符的字符串。点击提交后,表单将通过

重置
this.$formulate.reset(‘[name-of-the-form]‘)

确实清除了表格。但是验证信息没有再出现。

需要做些什么来解决这个问题?或者这可能是一个错误?

根据指定的验证行为,$formulate.resetValidation() 方法似乎有点过于激进。您可以通过对表单应用引用来“撤消”此操作,然后显式遍历注册表:

<FormulateForm
  ...
  ref="form"
>
// in your submit handler:
this.$refs.form.registry.map((input) => {
  input.formShouldShowErrors = true;
})

更新复制:https://codesandbox.io/s/vue-formulate-reseting-form-does-not-initiate-validation-message-again-forked-kn12h?file=/src/components/Reproduction.vue