From 36b71142347dc524e18fa24c5ffdffff0d02287a Mon Sep 17 00:00:00 2001 From: long <515897141@qq.com> Date: 星期二, 02 二月 2021 18:56:28 +0800 Subject: [PATCH] 优化列表、回到顶部组件、优化样式 --- src/pages/login/index.vue | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index a48c623..61d0696 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -3,7 +3,7 @@ <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left"> <div class="title-container"> - <h3 class="title">琚佹洣钘忛厭</h3> + <h3 class="title">鈥濋」鐩悕绉扳��</h3> </div> <el-form-item prop="username"> @@ -18,6 +18,7 @@ type="text" tabindex="1" autocomplete="on" + maxlength="20" @keyup.enter.native="handleLogin" /> </el-form-item> @@ -36,6 +37,7 @@ name="password" tabindex="2" autocomplete="on" + maxlength="20" @keyup.native="checkCapslock" @blur="capsTooltip = false" @keyup.enter.native="handleLogin" @@ -58,6 +60,7 @@ name="safecode" type="text" tabindex="3" + maxlength="10" autocomplete="off" @keyup.enter.native="handleLogin" /> @@ -114,9 +117,9 @@ checkedId: '' }, loginRules: { - username: [{ required: true, trigger: 'change', validator: validateUsername }], - password: [{ required: true, trigger: 'change', validator: validatePassword }], - safecode: [{ required: true, trigger: 'change', validator: validateSafecode }] + username: [{ required: true, trigger: 'blur', validator: validateUsername }], + password: [{ required: true, trigger: 'blur', validator: validatePassword }], + safecode: [{ required: true, trigger: 'blur', validator: validateSafecode }] }, passwordType: 'password', capsTooltip: false, @@ -144,7 +147,7 @@ }, methods: { init() { - var loginData = localStorage.getItem('loginData') + var loginData = localStorage.getItem('loginData_XXXX') // 鑾峰彇淇濆瓨鐨勮处鍙峰瘑鐮� if (loginData) this.loginForm = JSON.parse(loginData) @@ -233,7 +236,7 @@ username: this.loginForm.username.trim(), password: this.loginForm.password.trim() }) - localStorage.setItem('loginData', loginData) + localStorage.setItem('loginData_XXXX', loginData) // 淇濆瓨鐢ㄦ埛鏁版嵁 setUserData(inf) @@ -283,6 +286,11 @@ /* reset element-ui css */ .login-container { + // 鑳屾櫙 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌 + // background: url(../../assets/imgs/loginBg.jpg) no-repeat; + // background-size: cover; + // 鑳屾櫙 鈫戔啈鈫戔啈鈫戔啈鈫戔啈鈫戔啈 + background-color: $bg; .el-input { display: inline-block; height: 47px; @@ -323,16 +331,23 @@ .login-container { min-height: 100%; width: 100%; - background-color: $bg; + // background-color: $bg; overflow: hidden; .login-form { position: relative; width: 520px; max-width: 100%; - padding: 160px 35px 0; + padding: 35px 35px 0; margin: 0 auto; + margin-top: 160px; overflow: hidden; + // 鑳屾櫙 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌 + // background-color: $bg; + // opacity: .96; + // border-radius: 10px; + // box-shadow: 0px 20px 60px rgba(0,0,0,0.4), 0px 0px 150px rgba(0,0,0,0.4); + // 鑳屾櫙 鈫戔啈鈫戔啈鈫戔啈鈫戔啈鈫戔啈 } .tips { -- Gitblit v1.8.0