55
55
name =" username"
56
56
id =" username"
57
57
ref =" usernameInput"
58
- oninput = " setCustomValidity('') "
58
+ @input = " clearUsernameValidity "
59
59
@keydown.enter =" passwordInput.focus()"
60
60
class =" w-full"
61
61
placeholder =
" [email protected] " required />
66
66
v-model =" password"
67
67
ref =" passwordInput"
68
68
autocomplete =" current-password"
69
- oninput = " setCustomValidity('') "
69
+ @input = " clearPasswordValidity "
70
70
@keydown.enter =" login"
71
71
:type =" !showPw ? 'password': 'text'" name =" password" id =" password" placeholder =" ••••••••" class =" w-full" required >
72
72
<template #rightIcon >
@@ -141,8 +141,8 @@ import { useI18n } from 'vue-i18n';
141
141
142
142
const { t } = useI18n ();
143
143
144
- const passwordInput = ref (null );
145
- const usernameInput = ref (null );
144
+ const passwordInput = ref< HTMLInputElement | null > (null )
145
+ const usernameInput = ref< HTMLInputElement | null > (null )
146
146
const rememberMeValue = ref (false );
147
147
const username = ref (' ' );
148
148
const password = ref (' ' );
@@ -162,6 +162,14 @@ const backgroundPosition = computed(() => {
162
162
return coreStore .config ? .loginBackgroundPosition || ' 1/2' ;
163
163
});
164
164
165
+ function clearPasswordValidity () {
166
+ passwordInput .value ? .setCustomValidity (' test' )
167
+ }
168
+
169
+ function clearUsernameValidity () {
170
+ usernameInput .value ? .setCustomValidity (' test' )
171
+ }
172
+
165
173
onBeforeMount (() => {
166
174
if (localStorage .getItem (' isAuthorized' ) === ' true' ) {
167
175
// if route has next param, redirect
0 commit comments