MFL
MFL

Reputation: 37

Vue validation with Vuetify

I'm working with a form done using Vuetify and my question is, how can I add a success attribute to the v-text-field once the input has been validated by the :rules?

<v-text-field
    v-model="halfPayment.month"
    v-mask="'##'"
    :rules="[$rules.required, $rules.minCharacters(2), $rules.between(1, 12)]"
    label="month expired"
    outlined
    dense
    :success=
    background-color="white"
/>

Upvotes: 0

Views: 170

Answers (1)

Thaeke Hekkenberg
Thaeke Hekkenberg

Reputation: 378

You can add

:success="!!halfPayment.month"

to the text field to show when it successfully passed the validation rules. I hope this helps, otherwise, you can just drop a comment!

Upvotes: 1

Related Questions