1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-28 09:39:41 +02:00
mealie/frontend/pages/recipe/_slug/index.vue

34 lines
675 B
Vue
Raw Normal View History

<template>
<div>
<RecipePage v-if="recipe" :recipe="recipe" />
</div>
</template>
<script lang="ts">
import { defineComponent, useRoute } from "@nuxtjs/composition-api";
import RecipePage from "~/components/Domain/Recipe/RecipePage/RecipePage.vue";
import { useRecipe } from "~/composables/recipes";
export default defineComponent({
components: { RecipePage },
setup() {
const route = useRoute();
const slug = route.value.params.slug;
const { recipe, loading } = useRecipe(slug);
return {
recipe,
loading,
};
},
2023-10-19 18:28:30 +02:00
head() {
if (this.recipe) {
return {
title: this.recipe.name
}
}
}
});
</script>