Determining whether the password visible / login state determination / verification determination rule defined rules (iView) form in the form

A: to determine whether the password is visible
judgment: type = "visiblePassword 'text' :? 'Password'" whether it is true or false password input box or text box
Click the eye button @ click.native = "visiblePassword = visiblePassword! " Negated to

II: Analyzing login state
{{loading 'log in':? 'Login'}} login state determination login

III: determining rules validation rules defined by the form the form

<i-form class="login-form" :model="formData" :rules="formRules" ref="form"> 给表单:rules="formRules"
<i-form-item prop="username"> 给每一项 prop="username"
<i-input
v-model.trim="formData.username"
prefix="md-person"
:maxlength="12"
autocomplete="off"
autofocus
clearable
placeholder="请输入用户名"
@keyup.enter.native="submit()"
/>
</i-form-item>

data () {
return {
formRules: {in the data definition rules
username: [
{required: to true, Message: 'account can not be empty', Trigger: 'Blur'}
],
password: [{required: to true, Message: ' password can not be empty ', Trigger:' Blur '}]
},
visiblePassword: to false
}
},

Guess you like

Origin www.cnblogs.com/xiaoxiaoxun/p/11797184.html