feat: automatically focus username field on login page

This commit is contained in:
Oleg Lobanov 2022-05-04 00:44:32 +04:00
parent e5fa96b666
commit 596c73288f
No known key found for this signature in database
GPG Key ID: 65FF3DB864FE3D2A
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,7 @@
class="input input--block" class="input input--block"
type="text" type="text"
autocapitalize="off" autocapitalize="off"
ref="username"
v-model="username" v-model="username"
:placeholder="$t('login.username')" :placeholder="$t('login.username')"
/> />
@ -70,6 +71,8 @@ export default {
}; };
}, },
mounted() { mounted() {
this.focusUsername();
if (!recaptcha) return; if (!recaptcha) return;
window.grecaptcha.ready(function () { window.grecaptcha.ready(function () {
@ -79,6 +82,9 @@ export default {
}); });
}, },
methods: { methods: {
focusUsername() {
this.$refs.username.focus();
},
toggleMode() { toggleMode() {
this.createMode = !this.createMode; this.createMode = !this.createMode;
}, },