mealie/frontend/pages/index.vue
hay-kot 9386cc320b refactor(frontend): 🚧 Migrate Dashboard to Nuxt
Add API and Functinality for Admin Dashboard. Stills needs to clean-up. See // TODO's
2021-08-07 15:12:25 -08:00

36 lines
No EOL
903 B
Vue

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