Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VeeValidate, Confirmed rule not working on ValidationProvider

I am trying to add vee-validate rule on Validation Provider of password and confirm password. v-validate must be working where I had to add rules to a textbox. But here in my case, I must have to use Validation Provider. Please help!!!

Versions

vee-validate: 2.1.7
vue: 2.9.6

Code

<ValidationObserver ref="adminInfo">
<v-layout row wrap>
<v-flex xs12 md6>
    <ValidationProvider name="password" rules="required|min:5|max:35" ref="password">
    <v-text-field
      solo
      v-model="administratorInfo.newPassword"
      label="Set New Password"
      required

      slot-scope="{
          errors,
          valid
        }"
      :error-messages="errors"
      :success="valid"
    ></v-text-field>
    </ValidationProvider>
  </v-flex>
  <v-flex xs12 md6>
    <ValidationProvider name="confirm password" rules="'required|confirmed:password'">
    <v-text-field
      solo
      v-model="administratorInfo.cNewPassword"
      label="Confirm Password"
      required
      slot-scope="{
          errors,
          valid
        }"
      :error-messages="errors"
      :success="valid"
    ></v-text-field>
    </ValidationProvider>
  </v-flex>
</v-layout>
</ValidationObserver>

Getting error:

Cannot read property '$watch' of undefined

like image 623
Prashant Avatar asked Mar 11 '19 19:03

Prashant


1 Answers

Finally found solution by replacing ref="password" to vid="password". Found solution here.

But I did not understood what is and why vid?

like image 150
Prashant Avatar answered Sep 22 '22 23:09

Prashant