5
votes

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

1

1 Answers

9
votes

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

But I did not understood what is and why vid?