You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Promise state of formRef.value.validate() is always rejected, errorFields is 0, and outOfDate is true when using form component during form validation
#7852
Open
1 task
wangshilin123 opened this issue
Sep 22, 2024
· 0 comments
It should be "fulfilled" in the promise state to proceed with the next code execution.
What is actually happening?
The promise state of formRef.value.validate() is always rejected, consistently caught by catch, causing the program to exit due to the error.
When I changed the component from a-form to Naive UI's n-form, the promise state was fulfilled, so I suspect it's a bug. Since I'm new to learning Vue, I don't know how to resolve it.
The text was updated successfully, but these errors were encountered:
Version
4.2.5
Environment
win11,Chrome128.0.6613.138,[email protected]
Reproduction link
Steps to reproduce
<a-form
ref="formRef"
:model="formState"
:rules="formRules"
@submit.prevent="handleSubmit"
class="login-form"
import { reactive, ref } from 'vue'
const formRef = ref()
const formRules = {
username: [{ required: true, message: 'username', trigger: 'blur' }],
password: [{ required: true, message: 'password', trigger: 'blur' }],
}
const handleSubmit = async () => {
try {
await formRef.value.validate()
....}
catch (errors) {
console.error(errors)
}
}
What is expected?
It should be "fulfilled" in the promise state to proceed with the next code execution.
What is actually happening?
The promise state of formRef.value.validate() is always rejected, consistently caught by catch, causing the program to exit due to the error.
When I changed the component from a-form to Naive UI's n-form, the promise state was fulfilled, so I suspect it's a bug. Since I'm new to learning Vue, I don't know how to resolve it.
The text was updated successfully, but these errors were encountered: