Explorar el Código

登录button添加loading属性,校验失败属性变为false

ZhangWenQiang hace 6 años
padre
commit
e633ebd4ab
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/views/user/Login.vue

+ 5 - 2
src/views/user/Login.vue

@@ -215,7 +215,7 @@
         let loginParams = {
           remember_me: that.formLogin.rememberMe
         }
-        that.loading = true
+        that.loading = true;
         // 使用账户密码登陆
         if (that.customActiveKey === 'tab1') {
           that.form.validateFields(['username', 'password', 'inputCode'], { force: true }, (err, values) => {
@@ -228,7 +228,10 @@
               }).catch((err) => {
                 that.requestFailed(err)
               })
-
+            }else{
+              setTimeout(function() {
+                that.loading = false;
+              },1000)
             }
           })
           // 使用手机号登陆