From 065d6d31a375cb0fc838c30649ffd5b18616d611 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 27 Sep 2019 16:38:26 -0400 Subject: [PATCH] [O] Hit enter to login --- src/components/login/login.ts | 9 +++++++++ src/components/login/login.vue | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/login/login.ts b/src/components/login/login.ts index dcab806..cadae63 100644 --- a/src/components/login/login.ts +++ b/src/components/login/login.ts @@ -4,6 +4,7 @@ import {HttpUtils} from '@/utils/http-utils'; /** * This component handles user login, and obtains data from the server. + * TODO: Press enter to login */ @Component({ components: {}, @@ -70,4 +71,12 @@ export default class Login extends Vue this.loading = false; }); } + + /** + * This is called when the user hits enter in the input boxes. + */ + public onEnter() + { + this.onLoginClick(); + } } diff --git a/src/components/login/login.vue b/src/components/login/login.vue index bd52eae..6a03b1d 100644 --- a/src/components/login/login.vue +++ b/src/components/login/login.vue @@ -8,13 +8,15 @@ + :class="{'input-error': error !== ''}" + @keyup.enter.native="onEnter"> + :class="{'input-error': error !== ''}" + @keyup.enter.native="onEnter">
{{error}}