Explorar o código

登录切换状态清空数据

huangb %!s(int64=7) %!d(string=hai) anos
pai
achega
15f251bc42
Modificáronse 1 ficheiros con 15 adicións e 2 borrados
  1. 15 2
      components/login/Login.vue

+ 15 - 2
components/login/Login.vue

@@ -47,8 +47,8 @@
       </div>
       <div class="x-login-wrap">
         <div class="login-tab" v-show="loginWay != 2">
-          <span @click="loginWay = 0" v-bind:class="{'active': loginWay === 0 }">密码登录</span>
-          <span @click="loginWay = 3" v-bind:class="{'active': loginWay === 3 }">短信登录</span>
+          <span @click="toggleTab(0)" v-bind:class="{'active': loginWay === 0 }">密码登录</span>
+          <span @click="toggleTab(3)" v-bind:class="{'active': loginWay === 3 }">短信登录</span>
           <span @click="ShowWechatCoe(1)" v-bind:class="{'active': loginWay === 1 }" id="weChatBtn">微信登录</span>
          </div>
         <!--账号密码登录-->
@@ -401,6 +401,19 @@
       }
     },
     methods: {
+      // resetForm (formName) {
+      //   if (this.$refs[formName] === undefined) {
+      //     this.$refs[formName].resetFields()
+      //   }
+      // },
+      toggleTab (type) {
+        this.loginWay = type
+        this.login.username = ''
+        this.login.password = ''
+        this.fastLogin.mobile = ''
+        this.fastLogin.code = ''
+        // this.resetForm(whichForm)
+      },
       ShowWechatCoe () {
         wxLogin()
         this.loginWay = 1