vue validator怎么验证表单不能为空
展开全部
解决了 用touched判断元素是否聚焦过
<label class="form-title" for="new_pass">新密码:</label>
<input id="new_pass" v-validate:new-pass="{required: true, maxlength: 18, minlength: 6}" class="form-control" placeholder="请输入新密码" v-model="newPass"/>
<div v-if="$validation.newPass.touched" class="errors">
<div v-if="
<label class="form-title" for="new_pass">新密码:</label>
<input id="new_pass" v-validate:new-pass="{required: true, maxlength: 18, minlength: 6}" class="form-control" placeholder="请输入新密码" v-model="newPass"/>
<div v-if="$validation.newPass.touched" class="errors">
<div v-if="
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询