1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 13:35:23 +02:00

feat: Migrate to Nuxt 3 framework (#5184)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Hoa (Kyle) Trinh 2025-06-20 00:09:12 +07:00 committed by GitHub
parent 89ab7fac25
commit c24d532608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
403 changed files with 23959 additions and 19557 deletions

View file

@ -1,13 +1,23 @@
<template>
<v-container fill-height fluid class="d-flex justify-center align-center">
<v-card color="background d-flex flex-column align-center" flat width="600px">
<v-card-title class="headline justify-center"> {{ $t('user.forgot-password') }} </v-card-title>
<v-container
fill-height
fluid
class="d-flex justify-center align-center"
>
<v-card
color="background d-flex flex-column align-center"
flat
width="600px"
>
<v-card-title class="headline justify-center">
{{ $t('user.forgot-password') }}
</v-card-title>
<BaseDivider />
<v-card-text>
<v-form @submit.prevent="requestLink()">
<v-text-field
v-model="email"
filled
variant="filled"
rounded
autofocus
class="rounded-lg"
@ -15,11 +25,21 @@
:label="$t('user.email')"
type="text"
/>
<p class="text-center">{{ $t('user.forgot-password-text') }}</p>
<p class="text-center">
{{ $t('user.forgot-password-text') }}
</p>
<v-card-actions class="justify-center">
<div class="max-button">
<v-btn :loading="loading" color="primary" type="submit" large rounded class="rounded-xl" block>
<v-icon left>
<v-btn
:loading="loading"
color="primary"
type="submit"
size="large"
rounded
class="rounded-xl"
block
>
<v-icon start>
{{ $globals.icons.email }}
</v-icon>
{{ $t("user.reset-password") }}
@ -28,26 +48,41 @@
</v-card-actions>
</v-form>
</v-card-text>
<v-btn class="mx-auto" text nuxt to="/login"> {{ $t("user.login") }} </v-btn>
<v-btn
class="mx-auto"
variant="text"
nuxt
to="/login"
>
{{ $t("user.login") }}
</v-btn>
</v-card>
</v-container>
</template>
<script lang="ts">
import { defineComponent, toRefs, reactive, useContext } from "@nuxtjs/composition-api";
import { useUserApi } from "~/composables/api";
import { alert } from "~/composables/use-toast";
export default defineComponent({
layout: "basic",
export default defineNuxtComponent({
setup() {
definePageMeta({
layout: "basic",
});
const state = reactive({
email: "",
loading: false,
error: false,
});
const { i18n } = useContext();
const i18n = useI18n();
// Set page title
useSeoMeta({
title: i18n.t("user.login"),
});
const api = useUserApi();
async function requestLink() {
@ -58,11 +93,12 @@ export default defineComponent({
if (response?.status === 200) {
state.loading = false;
state.error = false;
alert.success(i18n.tc("profile.email-sent"));
} else {
alert.success(i18n.t("profile.email-sent"));
}
else {
state.loading = false;
state.error = true;
alert.error(i18n.tc("profile.error-sending-email"));
alert.error(i18n.t("profile.error-sending-email"));
}
}
@ -71,12 +107,6 @@ export default defineComponent({
...toRefs(state),
};
},
head() {
return {
title: this.$tc("user.login"),
};
},
});
</script>