Showing recipe card when data is ready

This commit is contained in:
Artur Nowakowski 2020-01-19 19:24:47 +01:00
parent 75b57870de
commit 23950dc83e

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div v-if="loaded">
<Card> <Card>
<p slot="title">{{ name }}</p> <p slot="title">{{ name }}</p>
<Row type="flex" justify="right" style="margin-bottom: 10px;"> <Row type="flex" justify="right" style="margin-bottom: 10px;">
@ -56,6 +56,7 @@
description: '', description: '',
ingredients: [], ingredients: [],
steps: [], steps: [],
loaded: false,
nutrition: { nutrition: {
kcal: 0, kcal: 0,
carbohydrates: 0, carbohydrates: 0,
@ -78,6 +79,7 @@
this.ingredients = data.ingredients; this.ingredients = data.ingredients;
this.steps = data.steps; this.steps = data.steps;
this.nutrition = data.nutrition; this.nutrition = data.nutrition;
this.loaded = true;
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);