Skip to content

Commit

Permalink
feat:add showPwd
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Nov 29, 2017
1 parent 890cfe5 commit 29ec7f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Binary file modified favicon.ico
Binary file not shown.
14 changes: 12 additions & 2 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<span class="svg-container">
<svg-icon icon-class="password"></svg-icon>
</span>
<el-input name="password" type="password" @keyup.enter.native="handleLogin" v-model="loginForm.password" autoComplete="on"
<el-input name="password" :type="pwdType" @keyup.enter.native="handleLogin" v-model="loginForm.password" autoComplete="on"
placeholder="password"></el-input>
<span class="show-pwd" @click="showPwd"><svg-icon icon-class="eye" /></span>
</el-form-item>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
Expand Down Expand Up @@ -58,10 +59,18 @@ export default {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false
loading: false,
pwdType: 'password'
}
},
methods: {
showPwd() {
if (this.pwdType === 'password') {
this.pwdType = ''
} else {
this.pwdType = 'password'
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
Expand Down Expand Up @@ -154,6 +163,7 @@ export default {
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select:none;
}
.thirdparty-button{
position: absolute;
Expand Down

0 comments on commit 29ec7f8

Please sign in to comment.