我正在尝试在密码的验证提供者上添加vee-validate规则并确认密码。 v-validate必须在必须向文本框添加规则的地方工作。但是在这种情况下,我必须使用Validation Provider。请帮忙!!!
版本
vee-validate: 2.1.7
vue: 2.9.6
代码
<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>
获取错误:
无法读取未定义的属性“ $ watch”