Answer the question
In order to leave comments, you need to log in
How to use scope in vee-validate?
good afternoon!
there is a type code
<form @submit.prevent="authenticate('auth')" data-vv-scope="auth">
<div class="formGroup">
<label for="username">Введите логин</label>
<input type="text" name="username" v-validate="'email'">
<span class="inputError" v-show="errors.first('auth.username')">Введите корректный адрес почты</span>
</div>
<div class="formGroup">
<label for="password">Введите пароль</label>
<input type="password" name="userPassword" v-validate="'min:6'">
<span class="inputError" v-show="errors.first('auth.userPassword')">Введите корректный пароль</span>
</div>
<input type="submit" value="Войти" class="btnBig">
</form>
authenticate(scope){
this.$validator.validate(scope).then(result => {
if (!result) {
}else{
// do smthng
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question