Skip to content

FormModel组件中的validateField方法当指定了几个字段,内部实现是遍历校验,如果最后一个字端校验通过,不管前面有没有校验通过,最终都会通过。 #2596

@iJay

Description

@iJay
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.6.4

Environment

chrome, edge, safari,ie11

Reproduction link

Edit on CodeSandbox

Steps to reproduce

this.$refs.from.validateField(['name'], ['mobile'], (err) => {
// 这里name校验不通过,mobile校验通过
})

What is expected?

期待在回调函数的参数里能拿到全部的校验结果

What is actually happening?

因为内部实现是遍历然后调用validate方法,所以最后能拿到的结果仅仅是最后一个字端的校验结果

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions