表单验证
This commit is contained in:
parent
38e1cfd450
commit
13d6786499
|
@ -4,11 +4,11 @@
|
|||
<div class="avatar">
|
||||
<img src="../assets/logo.png" alt="logo">
|
||||
</div>
|
||||
<el-form class="login-from" :model="loginForm">
|
||||
<el-form-item label="">
|
||||
<el-form class="login-from" :rules="loginFormRules" :model="loginForm">
|
||||
<el-form-item prop="username" label="">
|
||||
<el-input v-model="loginForm.username" prefix-icon="iconfont icon-user"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-form-item prop="password" label="">
|
||||
<el-input v-model="loginForm.password" type="password" prefix-icon="iconfont icon-3702mima"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="btns">
|
||||
|
@ -28,6 +28,16 @@ export default {
|
|||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginFormRules: {
|
||||
username: [
|
||||
{ required: true, message: '请输入登录名称', trigger: 'blur' },
|
||||
{ min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入登录密码', trigger: 'blur' },
|
||||
{ min: 6, max: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user