fix(components): [el-form] reset form validate error (#3759)

This commit is contained in:
btea 2021-11-05 05:45:45 -05:00 committed by GitHub
parent 07353a13e1
commit 9aa03ac774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,7 @@ import {
ref,
toRefs,
watch,
nextTick,
} from 'vue'
import { NOOP } from '@vue/shared'
import AsyncValidator from 'async-validator'
@ -245,8 +246,6 @@ export default defineComponent({
validateMessage.value = ''
}
const resetField = () => {
validateState.value = ''
validateMessage.value = ''
const model = elForm.model
const value = fieldValue.value
let path = props.prop
@ -259,6 +258,9 @@ export default defineComponent({
} else {
prop.o[prop.k] = initialValue
}
nextTick(() => {
clearValidate()
})
}
const getRules = () => {