In the el-form form el-form-item validation rule, prop verifies two or more values at a time

need

To verify two values ​​​​at once in the form's el-form-item, they cannot be empty.
Illustration:
Insert image description here

The picture below shows the circled area is the first value I want to verify.

Insert image description here

method

In the validation rules rules, add the validator validation rule to the value to be verified, and "valTowValue" is defined by yourself.
Insert image description here
Then define the validator verification rules under data.
Insert image description here
If you need to verify multiple items in one el-form-item, the method is the same. Just judge a few more in valTowValue.

Guess you like

Origin blog.csdn.net/weixin_44220845/article/details/117568622