Cannot validate q-datetime as required



  • Hi,
    I’m having a q-datetime inside a q-field and trying to validate it as required:

    <q-field label="Due date"
        :error="$v.entity.period_repetition_config.due_date.$error"
        errorLabel="Required!">
        <q-datetime v-model="entity.period_repetition_config.due_date"
            type="date"
            @input="$v.entity.period_repetition_config.due_date.$touch"
            @blur="$v.entity.period_repetition_config.due_date.$touch"
            format="DD/MM/YYYY" />
    </q-field>
    

    My validation config is:

      validations: {
        entity: {
          period_repetition_config: {
            due_date: {
              required
            }
          },
        }
      },
    

    The problem is after setting a date the field still shows the required error label.
    Thanks!


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.