[O] Hit enter to login

This commit is contained in:
Hykilpikonna
2019-09-27 16:38:26 -04:00
parent d8eb160123
commit 065d6d31a3
2 changed files with 13 additions and 2 deletions
+9
View File
@@ -4,6 +4,7 @@ import {HttpUtils} from '@/utils/http-utils';
/** /**
* This component handles user login, and obtains data from the server. * This component handles user login, and obtains data from the server.
* TODO: Press enter to login
*/ */
@Component({ @Component({
components: {}, components: {},
@@ -70,4 +71,12 @@ export default class Login extends Vue
this.loading = false; this.loading = false;
}); });
} }
/**
* This is called when the user hits enter in the input boxes.
*/
public onEnter()
{
this.onLoginClick();
}
} }
+4 -2
View File
@@ -8,13 +8,15 @@
<el-input v-model="username" <el-input v-model="username"
placeholder="School Username" placeholder="School Username"
:class="{'input-error': error !== ''}"> :class="{'input-error': error !== ''}"
@keyup.enter.native="onEnter">
</el-input> </el-input>
<el-input v-model="password" <el-input v-model="password"
placeholder="Veracross Password" placeholder="Veracross Password"
show-password="" show-password=""
:class="{'input-error': error !== ''}"> :class="{'input-error': error !== ''}"
@keyup.enter.native="onEnter">
</el-input> </el-input>
<div class="el-form-item__error custom">{{error}}</div> <div class="el-form-item__error custom">{{error}}</div>