diff --git a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue
index 0014966db..7dc46343b 100644
--- a/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue
+++ b/frontend/src/components/Recipe/RecipeViewer/Ingredients.vue
@@ -3,23 +3,22 @@
{{ $t("recipe.ingredients") }}
@@ -37,18 +36,27 @@ export default {
props: {
ingredients: Array,
},
- computed: {
- displayIngredients() {
- return this.ingredients.map(x => ({
- text: x,
- checked: false,
- }));
+ data() {
+ return {
+ checked: [],
+ };
+ },
+ mounted() {
+ this.checked = this.ingredients.map(() => false);
+ console.log(this.checked);
+ },
+ watch: {
+ ingredients(val) {
+ console.log(val);
},
},
methods: {
generateKey(item, index) {
return utils.generateUniqueKey(item, index);
},
+ toggleChecked(index) {
+ this.$set(this.checked, index, !this.checked[index]);
+ },
},
};