refactored ingredient components

This commit is contained in:
vabene1111
2021-01-13 18:42:59 +01:00
parent 98aadf2869
commit 9f51b9fd16
5 changed files with 40 additions and 19 deletions

View File

@ -81,15 +81,11 @@
<br/>
<div class="row">
<div class="col-md-12">
<table class="table table-sm">
<!-- eslint-disable vue/no-v-for-template-key-on-child -->
<template v-for="s in recipe.steps">
<template v-for="i in s.ingredients">
<Ingredient v-bind:ingredient="i" v-bind:servings="servings" :key="i.id"></Ingredient>
</template>
<Ingredients :step="s" :servings="servings" :key="s.id"></Ingredients>
</template>
<!-- eslint-enable vue/no-v-for-template-key-on-child -->
</table>
</div>
</div>
</div>
@ -143,7 +139,7 @@ import {apiLoadRecipe} from "@/utils/api";
import Step from "@/components/Step";
import RecipeContextMenu from "@/components/RecipeContextMenu";
import {GettextMixin, ToastMixin} from "@/utils/utils";
import Ingredient from "@/components/Ingredient";
import Ingredients from "@/components/Ingredients";
import PdfViewer from "@/components/PdfViewer";
import ImageViewer from "@/components/ImageViewer";
@ -164,7 +160,7 @@ export default {
components: {
PdfViewer,
ImageViewer,
Ingredient,
Ingredients,
Step,
RecipeContextMenu,
Nutrition,