Skip to content

Commit

Permalink
fix: reset error if account/passwd change
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Sep 1, 2019
1 parent 6424808 commit ae529fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/renderer/windows/main/LoginPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<v-combobox ref="accountInput" v-model="account" dark prepend-icon="person" :label="$t(`login.${selectedMode}.account`)"
:rules="accountRules" :items="history" :error="accountError" :error-messages="accountErrors"
required @input="accountError=false" />
required
@keypress="resetError" @input="accountError=false" />

<!-- <v-text-field dark prepend-icon="person" :label="$t(`${selectedMode}.account`)" :rules="accountRules" v-model="account" :error="accountError" :error-messages="accountErrors" required @keypress="handleKey"></v-text-field> -->
<v-text-field v-model="password" dark prepend-icon="lock" :label="$t(`login.${selectedMode}.password`)"
Expand Down Expand Up @@ -89,7 +90,14 @@ export default {
},
mounted() { },
methods: {
resetError() {
this.accountError = false;
this.accountErrors = [];
this.passwordError = false;
this.passwordErrors = [];
},
handleKey(e) {
this.resetError();
if (e.key === 'Enter') {
this.login();
}
Expand Down

0 comments on commit ae529fd

Please sign in to comment.