fix(components): [form] clear validate after resetFields (#6758)

This commit is contained in:
三咲智子 2022-03-24 15:40:42 +08:00 committed by GitHub
parent b51c37ad29
commit 8639b58583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,12 +282,14 @@ const clearValidate: FormItemContext['clearValidate'] = () => {
validateMessage.value = ''
}
const resetField: FormItemContext['resetField'] = () => {
const resetField: FormItemContext['resetField'] = async () => {
const model = formContext.model
if (!model || !props.prop) return
getProp(model, props.prop).value = initialValue
nextTick(() => clearValidate())
await nextTick()
await nextTick()
clearValidate()
}
watch(