mealie/frontend/pages/index.vue

32 lines
822 B
Vue
Raw Normal View History

2021-07-31 22:00:28 +00:00
<template>
2021-08-02 03:24:47 +00:00
<v-container>
<RecipeCardSection
:icon="$globals.icons.primary"
:title="$t('general.recent')"
:recipes="recipes"
></RecipeCardSection>
2021-08-02 03:24:47 +00:00
</v-container>
2021-07-31 22:00:28 +00:00
</template>
<script lang="ts">
2021-08-02 03:24:47 +00:00
import { defineComponent, onMounted, ref } from "@nuxtjs/composition-api";
import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue";
import { useApiSingleton } from "~/composables/use-api";
2021-08-02 03:24:47 +00:00
import { Recipe } from "~/types/api-types/admin";
export default defineComponent({
2021-08-02 03:24:47 +00:00
components: { RecipeCardSection },
setup() {
const api = useApiSingleton();
2021-08-02 03:24:47 +00:00
const recipes = ref<Recipe[] | null>([]);
onMounted(async () => {
const { data } = await api.recipes.getAll();
recipes.value = data;
});
return { api, recipes };
},
});
</script>
2021-08-02 03:24:47 +00:00