1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-25 08:09:41 +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,57 +1,75 @@
<template>
<div class="text-center">
<v-snackbar v-model="toastAlert.open" top :color="toastAlert.color" timeout="2000" @input="toastAlert.open = false">
<v-icon dark left>
{{ icon }}
</v-icon>
<v-snackbar
v-model="toastAlert.open"
location="top"
:color="toastAlert.color"
timeout="2000"
>
<v-icon
v-if="icon"
dark
start
:icon="icon"
/>
{{ toastAlert.title }}
{{ toastAlert.text }}
<template #action="{ attrs }">
<v-btn text v-bind="attrs" @click="toastAlert.open = false"> {{ $t('general.close') }} </v-btn>
<template #actions>
<v-btn
variant="text"
@click="toastAlert.open = false"
>
{{ $t('general.close') }}
</v-btn>
</template>
</v-snackbar>
<v-snackbar
v-model="toastLoading.open"
content-class="py-2"
dense
bottom
right
:value="toastLoading.open"
density="compact"
location="bottom"
:timeout="-1"
:color="toastLoading.color"
@input="toastLoading.open = false"
>
<div class="d-flex flex-column align-center justify-start" @click="toastLoading.open = false">
<div
class="d-flex flex-column align-center justify-start"
@click="toastLoading.open = false"
>
<div class="mb-2 mt-0 text-subtitle-1 text-center">
{{ toastLoading.text }}
</div>
<v-progress-linear indeterminate color="white darken-2"></v-progress-linear>
<v-progress-linear
indeterminate
color="white-darken-2"
/>
</div>
</v-snackbar>
</div>
</template>
<script lang="ts">
import { computed, defineComponent } from "@nuxtjs/composition-api";
import { useNuxtApp } from "#app";
import { toastAlert, toastLoading } from "~/composables/use-toast";
export default defineComponent({
export default {
setup() {
const { $globals } = useNuxtApp();
const icon = computed(() => {
switch (toastAlert.color) {
case "error":
return "mdi-alert";
return $globals.icons.alertOutline;
case "success":
return "mdi-check-bold";
return $globals.icons.checkBold;
case "info":
return "mdi-information-outline";
return $globals.icons.informationOutline;
default:
return "mdi-alert";
return $globals.icons.alertOutline;
}
});
return { icon, toastAlert, toastLoading };
},
});
};
</script>