2021-07-31 14:45:28 -08:00
|
|
|
<template>
|
2022-08-27 10:44:58 -08:00
|
|
|
<div>
|
|
|
|
<RecipePage v-if="recipe" :recipe="recipe" />
|
|
|
|
</div>
|
2021-07-31 14:45:28 -08:00
|
|
|
</template>
|
2021-08-02 22:15:11 -08:00
|
|
|
|
|
|
|
<script lang="ts">
|
2022-08-27 10:44:58 -08:00
|
|
|
import { defineComponent, useRoute } from "@nuxtjs/composition-api";
|
|
|
|
import RecipePage from "~/components/Domain/Recipe/RecipePage/RecipePage.vue";
|
|
|
|
import { useRecipe } from "~/composables/recipes";
|
2021-11-06 14:32:55 -08:00
|
|
|
|
2022-08-27 10:44:58 -08:00
|
|
|
export default defineComponent({
|
|
|
|
components: { RecipePage },
|
2021-07-31 14:45:28 -08:00
|
|
|
setup() {
|
2021-08-02 22:15:11 -08:00
|
|
|
const route = useRoute();
|
|
|
|
const slug = route.value.params.slug;
|
|
|
|
|
2022-08-28 20:08:33 -08:00
|
|
|
const { recipe, loading } = useRecipe(slug);
|
2021-08-02 22:15:11 -08:00
|
|
|
|
|
|
|
return {
|
|
|
|
recipe,
|
|
|
|
loading,
|
|
|
|
};
|
|
|
|
},
|
2023-10-19 18:28:30 +02:00
|
|
|
head() {
|
|
|
|
if (this.recipe) {
|
|
|
|
return {
|
|
|
|
title: this.recipe.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-02 22:15:11 -08:00
|
|
|
});
|
2021-07-31 14:45:28 -08:00
|
|
|
</script>
|