fix(components): message verified by el-form is "" validate (#3227) (#3231)

This commit is contained in:
SongWuKong 2021-09-04 19:35:11 +08:00 committed by GitHub
parent 55348b30b6
commit 6f23947920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ export default defineComponent({
{ firstFields: true },
(errors, invalidFields) => {
validateState.value = !errors ? 'success' : 'error'
validateMessage.value = errors ? errors[0].message : ''
validateMessage.value = errors ? errors[0].message || `${props.prop} is required` : ''
callback(validateMessage.value, invalidFields)
elForm.emit?.(
'validate',