I want to validate a part first, and then the user will receive the mobile phone validation code, and then validate all when the user submits it. But I can't get the wrong information from this.errors.first('field') for the first time.
<template lang="html">
<div>
<form data-vv-scope="s">
<input type="text" v-validate="'required'" data-vv-name="s1">
<input type="text" v-validate="'required'" data-vv-name="s1">
<button @click="vali" type="button">submit</button>
<div @click="see">see</div>
</form>
</div>
</template>
<script>
import { ErrorBag } from 'vee-validate';
export default {
methods:{
vali () {
this.$validator.validateAll(["s1"]);
},
see () {
console.log(this.errors.first("s1")) //can't get the wrong information
}
}
}
</script>