logaretm / vee-validate

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

state.required stays false #4667

Closed emilsgulbis closed 4 months ago

emilsgulbis commented 8 months ago

What happened?

Tried to add required prop when using defineField but state.required always stays false Have tried with yup and Global validators

For nuxt/ui if the required props is positive - it auto adds asterisk * after the label

Reproduction steps

  1. Opened integrations page and choosed Nuxt UI example.
  2. Added required prop (but it always stays false)
const nuxtUiConfig = (state) => {
  return {
    props: {
      error: state.errors[0],
      required: state.required, // <!-- Not working
    },
  };
};

Version

Vue.js 3.4.13 and vee-validate 4.12.5

What browsers are you seeing the problem on?

Relevant log output

No response

Demo link

https://stackblitz.com/edit/nuxtlabs-ui-vee-validate-v4-affads?file=app.vue

Code of Conduct

logaretm commented 4 months ago

Fixed in c4415f8 and released in v4.12.8