-
Hey there. Im using yup for validation. I have next scheme:
And when i validating fields throw yup, works frine
Success result will be: But when i validating throw vee validate:
I will get full list of fields. How i can fix it? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'm not quite sure what the problem is but I assume it's that you're getting the two fields "second" and "first" output even though only one of the two is supposed to be there!? Maybe the reason for the difference is that yup itself only outputs the validated fields (but I don't know for sure either, I don't use yup myself). vee validate gives you the whole form, of course. Just because a field is not mandatory, it does not mean that it should not be present in the data. If you don't want the value to be present, you can simply hide it with v-if, for example, and then it won't be present in the vee validate data anymore. |
Beta Was this translation helpful? Give feedback.
-
aahhh... now I know what you mean. I'm pretty sure that "noUnknown" is ignored by vee validate. vee validate uses yup exclusively for validation. But it probably won't constrain the data. For that you have vee validate itself |
Beta Was this translation helpful? Give feedback.
aahhh... now I know what you mean.
I'm pretty sure that "noUnknown" is ignored by vee validate.
vee validate uses yup exclusively for validation. But it probably won't constrain the data. For that you have vee validate itself