logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.85k stars 1.28k forks source link

What is the replcement for `validateWithInfo` in v4 #4033

Closed Sakthi002 closed 1 year ago

Sakthi002 commented 1 year ago

What happened?

Currently in my project, I am trying to update vee-validate to latest version

Previously in v3 i used validateWithInfo for validating the form using $refs Screenshot from 2022-12-07 12-41-02

After updating to v4, i am getting this error Screenshot from 2022-12-07 12-41-49

Please help me to fix this issue

Reproduction steps

1. 2. 3. ...

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

Relevant log output

No response

Demo link

https://codesandbox.io/s/clever-wildflower-mm7g62?file=/src/App.vue

Code of Conduct

logaretm commented 1 year ago

You can use validate directly. It returns the same thing as validateWithInfo with some changes.

const result = await this.$refs.myForm.validate();
console.log(result); // { valid: false, errors: { field1: "error message" } };