No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to check child components for errors?

    Framework
    child-component q-step validation
    1
    2
    385
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rniestroj last edited by

      Hi,
      i have a QStepper with 3 QSteps. Each QStep has a few QInput. I want to set :error on a QStep if any of his child QInputs has an error for example a required field is missing.

      How to to this?

      I have code like this (this is the template in PUG):

      qstep(:error= hasStepError)
        .col-12.q-pa-sm 
           q-input.col-12.q-pa-sm(:rules="[val => !!val || 'Field is required']" :label='Label' )
      

      This hasStepError is a boolean field in data():

      data() {
        return {
          hasStepError: false,
      

      So when hasStepError is true i get the error icon on the step - how i want it

      047ab537-ca2c-4445-b5e0-443791445e74-obraz.png

      But now how can i change this hasStepError when one of the child components has an error?

      I have tried adding an eventlistener on the QInput like this: @input=‘onInput($event)’ but in $event i get the value not the components so i cannot check if it has an error.

      1 Reply Last reply Reply Quote 0
      • R
        rniestroj last edited by

        I saw QForm and QForm has an event @validation-error if any of his inner QInputs has an error but my GUI expects an save button on the end of the whole QStepper so this seems not quite feasible.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post