From df1bca6c6a8dd02f950c7cc0a3352ed543945a91 Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Fri, 23 Apr 2021 08:15:25 +0200 Subject: [PATCH] Fix ingredients not refreshed upon recipe change (#343) --- .../Recipe/RecipeViewer/Ingredients.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue index 1a29c14f5888..0014966dbf14 100644 --- a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue +++ b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue @@ -37,16 +37,13 @@ export default { props: { ingredients: Array, }, - data() { - return { - displayIngredients: [], - }; - }, - mounted() { - this.displayIngredients = this.ingredients.map(x => ({ - text: x, - checked: false, - })); + computed: { + displayIngredients() { + return this.ingredients.map(x => ({ + text: x, + checked: false, + })); + }, }, methods: { generateKey(item, index) {