我正在使用 Bootstrap-Vue 表单输入,并使用 Vuelidate 进行验证。目前,在用户输入时,我得到轮廓颜色(红色或绿色)和复选框或十字,具体取决于有效或无效。我现在想改变这种行为,使其仅在模糊时显示。我将以下代码行添加到我的输入中,但是发生了相同的行为:
@blur="$v.form.code_part1.$touch()"
这是我的完整输入代码,请您解释一下我哪里出错了,或者如何正确处理这个问题?
<b-form-input
:class="{ 'hasError': $v.form.code_part2.$error }"
placeholder="Next Four"
v-model="$v.form.code_part2.$model"
@blur="$v.form.code_part1.$touch()"
:state="$v.form.code_part2.$dirty ? !$v.form.code_part2.$error : null"
class="form-control mb-3"
name="Part 2"
id="code_part2"
type="text"
maxlength="4"
aria-label="Next Four"
></b-form-input>
最佳答案
关于vue.js - 如何使用 Vue.js 和 Vuelidate 验证模糊字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57924238/