在验证表单的时候,由于vue页面el-form的:model属性误写成v-model="vo",导致验证表单始终不正确。
错误写法:
<el-form v-model="vo" :rules="rules" ref="form" >
<el-form-item prop="email">
<el-input v-model="vo.email" style="width:90%;"></el-input>
</el-form-item>
<el-form-item prop="roleId">
<el-input v-model="vo.roleId" style="width:90%;"></el-input>
</el-form-item>
</el-form>
正确写法:
<el-form :model="vo" :rules="rules" ref="form" >
<el-form-item prop="email">
<el-input v-model="vo.email" style="width:90%;"></el-input>
</el-form-item>
<el-form-item prop="roleId">
<el-input v-model="vo.roleId" style="width:90%;"></el-input>
</el-form-item>
</el-form>
网友评论