From 7564997aba5f1378ab3b37489a18ca7bb60d2574 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 30 Jan 2020 12:41:06 +0800 Subject: [PATCH] feat: add the load animation to the login button. --- src/views/user/Login.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 4e1f7d98..1caddda7 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -47,6 +47,7 @@ :style="{'animation-delay': '0.3s'}" > { - // Go to dashboard - this.loginSuccess() - }) + this.landing = true + this.login({ username: this.username, password: this.password }) + .then(response => { + // Go to dashboard + this.loginSuccess() + }) + .finally(() => { + setTimeout(() => { + this.landing = false + }, 500) + }) }, loginSuccess() { // Cache the user info