Add eslint
This commit is contained in:
+75
-73
@@ -53,88 +53,90 @@ async function submit() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1 class="mb-4 text-center text-3xl">{{ t('auth.login') }}</h1>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-5">
|
||||
<VaForm
|
||||
ref="formRef"
|
||||
tag="form"
|
||||
class="flex flex-col items-baseline gap-6 sm:col-start-2 lg:col-start-3"
|
||||
@submit.prevent="submit"
|
||||
>
|
||||
<VaInput
|
||||
v-model="form.email"
|
||||
class="w-full"
|
||||
type="email"
|
||||
:label="t('auth.email')"
|
||||
autocomplete="email"
|
||||
:rules="[validation.required(t('auth.email'))]"
|
||||
:placeholder="t('auth.email')"
|
||||
required
|
||||
<div>
|
||||
<h1 class="mb-4 text-center text-3xl">{{ t('auth.login') }}</h1>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 lg:grid-cols-5">
|
||||
<VaForm
|
||||
ref="formRef"
|
||||
tag="form"
|
||||
class="flex flex-col items-baseline gap-6 sm:col-start-2 lg:col-start-3"
|
||||
@submit.prevent="submit"
|
||||
>
|
||||
<template #prependInner>
|
||||
<VaIcon name="mail_outline" color="secondary" />
|
||||
</template>
|
||||
</VaInput>
|
||||
<VaValue v-slot="isPasswordVisible" :default-value="false">
|
||||
<VaInput
|
||||
v-model="form.password"
|
||||
v-model="form.email"
|
||||
class="w-full"
|
||||
:type="isPasswordVisible.value ? 'text' : 'password'"
|
||||
:label="t('auth.password')"
|
||||
:placeholder="t('auth.password')"
|
||||
:rules="[
|
||||
validation.required(t('auth.password')),
|
||||
validation.min(t('auth.password'), 8)
|
||||
]"
|
||||
autocomplete="current-password"
|
||||
:minlength="8"
|
||||
type="email"
|
||||
:label="t('auth.email')"
|
||||
autocomplete="email"
|
||||
:rules="[validation.required(t('auth.email'))]"
|
||||
:placeholder="t('auth.email')"
|
||||
required
|
||||
>
|
||||
<template #prependInner>
|
||||
<VaIcon name="key" color="secondary" />
|
||||
</template>
|
||||
|
||||
<template #appendInner>
|
||||
<VaButton
|
||||
v-if="form.password"
|
||||
preset="plain"
|
||||
:title="
|
||||
t(
|
||||
isPasswordVisible.value
|
||||
? 'auth.hidePassword'
|
||||
: 'auth.showPassword'
|
||||
)
|
||||
"
|
||||
@click="isPasswordVisible.value = !isPasswordVisible.value"
|
||||
>
|
||||
<VaIcon
|
||||
:name="
|
||||
isPasswordVisible.value ? 'visibility_off' : 'visibility'
|
||||
"
|
||||
color="primary"
|
||||
/>
|
||||
</VaButton>
|
||||
<VaIcon name="mail_outline" color="secondary" />
|
||||
</template>
|
||||
</VaInput>
|
||||
</VaValue>
|
||||
<VaAlert
|
||||
v-if="error.length > 0"
|
||||
color="danger"
|
||||
class="w-full text-center"
|
||||
>{{ t(error) }}</VaAlert
|
||||
>
|
||||
<VaButtonGroup>
|
||||
<VaButton color="success" type="submit" :disabled="!isValid">{{
|
||||
t('auth.login')
|
||||
}}</VaButton>
|
||||
<VaButton
|
||||
:to="$localePath({ path: '/register', query: route.query })"
|
||||
border-color="primary"
|
||||
preset="secondary"
|
||||
>{{ t('auth.register_instead') }}</VaButton
|
||||
<VaValue v-slot="isPasswordVisible" :default-value="false">
|
||||
<VaInput
|
||||
v-model="form.password"
|
||||
class="w-full"
|
||||
:type="isPasswordVisible.value ? 'text' : 'password'"
|
||||
:label="t('auth.password')"
|
||||
:placeholder="t('auth.password')"
|
||||
:rules="[
|
||||
validation.required(t('auth.password')),
|
||||
validation.min(t('auth.password'), 8)
|
||||
]"
|
||||
autocomplete="current-password"
|
||||
:minlength="8"
|
||||
required
|
||||
>
|
||||
<template #prependInner>
|
||||
<VaIcon name="key" color="secondary" />
|
||||
</template>
|
||||
|
||||
<template #appendInner>
|
||||
<VaButton
|
||||
v-if="form.password"
|
||||
preset="plain"
|
||||
:title="
|
||||
t(
|
||||
isPasswordVisible.value
|
||||
? 'auth.hidePassword'
|
||||
: 'auth.showPassword'
|
||||
)
|
||||
"
|
||||
@click="isPasswordVisible.value = !isPasswordVisible.value"
|
||||
>
|
||||
<VaIcon
|
||||
:name="
|
||||
isPasswordVisible.value ? 'visibility_off' : 'visibility'
|
||||
"
|
||||
color="primary"
|
||||
/>
|
||||
</VaButton>
|
||||
</template>
|
||||
</VaInput>
|
||||
</VaValue>
|
||||
<VaAlert
|
||||
v-if="error.length > 0"
|
||||
color="danger"
|
||||
class="w-full text-center"
|
||||
>{{ t(error) }}</VaAlert
|
||||
>
|
||||
</VaButtonGroup>
|
||||
</VaForm>
|
||||
<VaButtonGroup>
|
||||
<VaButton color="success" type="submit" :disabled="!isValid">{{
|
||||
t('auth.login')
|
||||
}}</VaButton>
|
||||
<VaButton
|
||||
:to="$localePath({ path: '/register', query: route.query })"
|
||||
border-color="primary"
|
||||
preset="secondary"
|
||||
>{{ t('auth.register_instead') }}</VaButton
|
||||
>
|
||||
</VaButtonGroup>
|
||||
</VaForm>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user