diff --git a/pages/login/login/index.vue b/pages/login/login/index.vue index 885388c..50c0771 100644 --- a/pages/login/login/index.vue +++ b/pages/login/login/index.vue @@ -69,12 +69,17 @@ + + + + {{ errors.password @@ -157,6 +162,7 @@ export default { data() { return { isTeacher: false, // 是否是教师 + isShowPassword: false, // 是否显示密码 // 登录参数 loginParams: { @@ -197,11 +203,17 @@ export default { this.clearErrors(); this.clearLoginParams(); this.loginType = type; + this.isShowPassword = false; if (this.loginType === "code") { this.refreshCaptcha(); } }, + // 切换显示密码 + toggleShowPassword() { + this.isShowPassword = !this.isShowPassword; + }, + // 刷新图形验证码 refreshCaptcha() { // 获取图形验证码 @@ -694,6 +706,18 @@ export default { height: 100%; } } + + .show-password-icon { + position: absolute; + right: 10rpx; + top: 50%; + transform: translateY(-50%); + height: 60rpx; + width: 60rpx; + display: flex; + align-items: center; + justify-content: center; + } } } }