Skip to content

How can I get the Field meta in the Form? #3814

Answered by logaretm
Vivi-Ornitier asked this question in Q&A
Discussion options

You must be logged in to vote

You can rename destructed slot props

<Form v-slot="{ errors, meta: formMeta }">
  <Field
    v-slot="{ meta: fieldMeta }"
    type="text"
    maxlength="1"
    required
    rules="required|max:1"
    :class="{
      'text-error': meta.valid
    }"
  />
  
  <div v-if="formMeta.touched && ! formMeta.valid">
    Form has errors.
  </div>
</Form>

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Vivi-Ornitier
Comment options

@logaretm
Comment options

@Vivi-Ornitier
Comment options

@Vivi-Ornitier
Comment options

@Vivi-Ornitier
Comment options

Answer selected by Vivi-Ornitier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants