Hayden caa9e03050
refactor: recipe-page (#1587)
Refactor recipe page to use break up the component and make it more usable across different pages. I've left the old route in as well in case there is some functional breaks, I plan to remove it before the official release once we've tested the new editor some more in production. For now there will just have to be some duplicate components and pages around.
2022-08-27 10:44:58 -08:00

33 lines
721 B
Vue

<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 { useUserApi } from "~/composables/api";
import { useRecipe } from "~/composables/recipes";
export default defineComponent({
components: { RecipePage },
setup() {
const route = useRoute();
const slug = route.value.params.slug;
const api = useUserApi();
const { recipe, loading, fetchRecipe } = useRecipe(slug);
return {
recipe,
loading,
fetchRecipe,
api,
};
},
});
</script>
<style scoped></style>