mirror of https://github.com/Lissy93/dashy.git
🚸 Pressing enter submits login form (#483)
This commit is contained in:
parent
33855dca40
commit
c4f1be2b76
|
@ -14,6 +14,7 @@
|
|||
:name="name"
|
||||
:id="name"
|
||||
:placeholder="placeholder"
|
||||
@keyup.enter="onEnter ? onEnter() : () => {}"
|
||||
class="input-field"
|
||||
/>
|
||||
<p
|
||||
|
@ -35,6 +36,7 @@ export default {
|
|||
name: String, // Required unique ID value, for accessibility
|
||||
placeholder: String, // Optional placeholder value
|
||||
description: String, // Optional info paragraph
|
||||
onEnter: Function,
|
||||
type: {
|
||||
default: 'text', // Input type, e.g. text, password, number
|
||||
type: String,
|
||||
|
|
|
@ -21,15 +21,15 @@
|
|||
<!-- Main login form -->
|
||||
<form class="login-form" v-if="(!isUserAlreadyLoggedIn) && isAuthenticationEnabled">
|
||||
<h2 class="login-title">{{ $t('login.title') }}</h2>
|
||||
<Input
|
||||
<Input type="text"
|
||||
v-model="username"
|
||||
type="text"
|
||||
:onEnter="submitLogin"
|
||||
:label="$t('login.username-label')"
|
||||
class="login-field username"
|
||||
/>
|
||||
<Input
|
||||
<Input type="password"
|
||||
v-model="password"
|
||||
type="password"
|
||||
:onEnter="submitLogin"
|
||||
:label="$t('login.password-label')"
|
||||
class="login-field password"
|
||||
/>
|
||||
|
@ -38,6 +38,7 @@
|
|||
v-model="timeout"
|
||||
:selectOnTab="true"
|
||||
:options="dropDownMenu"
|
||||
:map-keydown="(map) => ({ ...map, 13: () => this.submitLogin() })"
|
||||
class="login-time-dropdown"
|
||||
/>
|
||||
<Button class="login-button" :click="submitLogin">
|
||||
|
|
Loading…
Reference in New Issue